diff options
author | David Cole <david.cole@kitware.com> | 2012-06-12 20:01:04 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-06-12 20:01:04 (GMT) |
commit | c95d1baa194c8108841a8b973d3bbe50ca7d5666 (patch) | |
tree | be3efd1ba2c1b58cb3d51242e246777527842efc /Tests/CMakeLists.txt | |
parent | c6f6929e31a3e8067633aa57cf0775bced9d8443 (diff) | |
parent | bd3496300262bd26073ce03e020731c592249148 (diff) | |
download | CMake-c95d1baa194c8108841a8b973d3bbe50ca7d5666.zip CMake-c95d1baa194c8108841a8b973d3bbe50ca7d5666.tar.gz CMake-c95d1baa194c8108841a8b973d3bbe50ca7d5666.tar.bz2 |
Merge topic 'position-independent-targets'
bd34963 Refactor generation of shared library flags
55d7aa4 Add platform variable for flags specific to shared libraries
31d7a0f Add platform variables for position independent code flags
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index ef707e4..9deb8ac 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -315,6 +315,24 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(Module.GenerateExportHeader GenerateExportHeader) + if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag(-fPIE run_pic_test) + else() + if (CMAKE_CXX_COMPILER_ID MATCHES "PGI" + OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale" + OR CMAKE_SYSTEM_NAME MATCHES "IRIX64" + OR CMAKE_CXX_COMPILER_ID MATCHES "Intel") + set(run_pic_test 0) + else() + set(run_pic_test 1) + endif() + endif() + + if (run_pic_test) + ADD_TEST_MACRO(PositionIndependentTargets PositionIndependentTargets) + endif() + ADD_TEST(LinkFlags-prepare ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test |