[CMake] Function for visibility definitions

Hilton Medeiros medeiros.hilton at gmail.com
Thu Feb 11 01:29:17 EST 2010


Thanks for pointing that mistake, I fixed it.

About g++: g++ is gcc with -lstdc++

What is wrong with a simple CMake file?
I know what is good about it, if CMake had it built in
neither me nor any CMake user would need to write neither a simple
header file nor a simple CMake file.

Kind regards,
Hilton

On Wed, 10 Feb 2010 22:37:47 +0100
Hendrik Sattler <post at hendrik-sattler.de> wrote:

> Am Mittwoch 10 Februar 2010 19:46:57 schrieb Hilton Medeiros:
> > macro (check_gcc_visibility)
> >     include (CheckCXXCompilerFlag)
> >     check_cxx_compiler_flag(-fvisibility=hidden
> > GCC_SUPPORTS_VISIBILITY) endmacro()
> 
> This macro does not check if gcc supports visibility but g++ instead.
> 
> > function (add_visibility_definitions)
> >     set (GCC_EXPORT __attribute__\(\(visibility\(\"default\"\)\)\))
> >     set (GCC_PRIVATE __attribute__\(\(visibility\(\"hidden\"\)\)\))
> >     set (WIN_EXPORT __declspec\(dllexport\))
> >     set (WIN_PRIVATE __declspec\(dllimport\))
> 
> Those are not correct: there is no equivalent of GCC_PRIVATE for MSVC.
> What's wrong with a simple header file?
> 
> HS



More information about the CMake mailing list