diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2014-01-31 15:09:06 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2014-02-01 08:55:24 (GMT) |
commit | efdcebddbdc47e91254461da40cec2be869a0940 (patch) | |
tree | 7af9af19107e401314c32e71ee28f413ef700c49 /Tests/CMakeLists.txt | |
parent | f35c01e2a5e3834094fbd98eccfc2a686872fceb (diff) | |
download | CMake-efdcebddbdc47e91254461da40cec2be869a0940.zip CMake-efdcebddbdc47e91254461da40cec2be869a0940.tar.gz CMake-efdcebddbdc47e91254461da40cec2be869a0940.tar.bz2 |
VisibilityInlinesHidden: only apply -fvisibility-inlines-hidden to C++ sources
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index a79111a..2807f97 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -400,6 +400,29 @@ if(BUILD_TESTING) ADD_TEST_MACRO(PositionIndependentTargets PositionIndependentTargets) endif() + if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") AND + (NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 4.2) AND + (CMAKE_SYSTEM_NAME MATCHES "Linux")) + + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag( + -fvisibility-inlines-hidden run_inlines_hidden_test) + endif() + + if(run_inlines_hidden_test) + add_test(VisibilityInlinesHidden ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VisibilityInlinesHidden" + "${CMake_BINARY_DIR}/Tests/VisibilityInlinesHidden" + ${build_generator_args} + --build-project VisibilityInlinesHidden + --build-options ${build_options} + ) + list(APPEND TEST_BUILD_DIRS + "${CMake_BINARY_DIR}/Tests/VisibilityInlinesHidden" + ) + endif() + add_test(LinkFlags-prepare ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test |