diff options
author | Brad King <brad.king@kitware.com> | 2013-06-26 13:02:10 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-06-26 13:02:10 (GMT) |
commit | 22fbeaa14b5d79bc065b1c3061359c886167cc01 (patch) | |
tree | 1feb8edfda420dc840514253df25ee19eb2b697e /Tests | |
parent | 1c517989405d7a25e669a25fd20f97fb112d279e (diff) | |
parent | 77ff352aa76e4b5e8b739b3098aa98b14acba8d6 (diff) | |
download | CMake-22fbeaa14b5d79bc065b1c3061359c886167cc01.zip CMake-22fbeaa14b5d79bc065b1c3061359c886167cc01.tar.gz CMake-22fbeaa14b5d79bc065b1c3061359c886167cc01.tar.bz2 |
Merge topic 'export-COMPILE_OPTIONS-property'
77ff352 Generate INTERFACE_COMPILE_OPTIONS on export.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/ExportImport/Import/A/deps_shared_iface.cpp | 6 |
3 files changed, 24 insertions, 1 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index e3f23b8..efecd03 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -162,7 +162,6 @@ set_property(TARGET testLibRequired APPEND PROPERTY $<BUILD_INTERFACE:BuildOnly_DEFINE> $<INSTALL_INTERFACE:InstallOnly_DEFINE> ) - include(GenerateExportHeader) add_subdirectory(renamed) @@ -201,6 +200,11 @@ set_property(TARGET testSharedLibRequired PROPERTY INTERFACE_CUSTOM_STRING testcontent ) +set_property(TARGET testSharedLibRequired APPEND PROPERTY + INTERFACE_COMPILE_OPTIONS + $<$<CXX_COMPILER_ID:GNU>:-DCUSTOM_COMPILE_OPTION> +) + add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp) set_property(TARGET testSharedLibDepends APPEND PROPERTY diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 65b1a36..3bfbc46 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -169,6 +169,13 @@ target_compile_definitions(deps_shared_iface $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH> ) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_definitions(deps_shared_iface + PRIVATE + "DO_GNU_TESTS" + ) +endif() + if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-fPIE run_pic_test) @@ -199,6 +206,12 @@ endif() add_executable(deps_shared_iface2 deps_shared_iface.cpp) target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib) +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_definitions(deps_shared_iface2 + PRIVATE + "DO_GNU_TESTS" + ) +endif() target_compile_definitions(deps_shared_iface2 PRIVATE TEST_SUBDIR_LIB $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON> diff --git a/Tests/ExportImport/Import/A/deps_shared_iface.cpp b/Tests/ExportImport/Import/A/deps_shared_iface.cpp index 32e04db..d5e4de3 100644 --- a/Tests/ExportImport/Import/A/deps_shared_iface.cpp +++ b/Tests/ExportImport/Import/A/deps_shared_iface.cpp @@ -25,6 +25,12 @@ #include "renamed.h" #endif +#ifdef DO_GNU_TESTS +#ifndef CUSTOM_COMPILE_OPTION +#error Expected CUSTOM_COMPILE_OPTION +#endif +#endif + int main(int,char **) { TestSharedLibDepends dep; |