Add a COMPILE_OPTION for a VISIBILITY_INLINES_HIDDEN target property.

This corresponds to the g++ and clang++
option -fvisibility-inlines-hidden on linux. On Windows with MinGW,
this corresponds to -fno-keep-inline-dllexport. That option is
not supported by clang currently.
This commit is contained in:
Stephen Kelly
2013-05-23 15:32:17 +02:00
parent 0e9f4bc00c
commit cd1fa537a0
5 changed files with 75 additions and 20 deletions
+2
View File
@@ -1,2 +1,4 @@
include(Compiler/Clang)
__compiler_clang(CXX)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
+10
View File
@@ -1,2 +1,12 @@
include(Compiler/GNU)
__compiler_gnu(CXX)
if (WIN32)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport")
endif()
else()
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
endif()