Add additonal tests for the linker flags

Extend Tests/LinkFlags to test libraries of the type MODULE and
the content of the CMAKE_*_LINKER_FLAGS_* variables.
This commit is contained in:
Patrick Gansterer 2013-07-28 20:34:16 +02:00 committed by Brad King
parent 20ed496b6d
commit 152dfdab11
4 changed files with 43 additions and 2 deletions

View File

@ -394,10 +394,20 @@ if(BUILD_TESTING)
endmacro()
ADD_LINK_FLAGS_TEST(lib prepare)
ADD_LINK_FLAGS_TEST(dll lib)
ADD_LINK_FLAGS_TEST(exe dll)
ADD_LINK_FLAGS_TEST(mod dll)
ADD_LINK_FLAGS_TEST(exe mod)
ADD_LINK_FLAGS_TEST(lib_config exe)
ADD_LINK_FLAGS_TEST(dll_config lib_config)
ADD_LINK_FLAGS_TEST(exe_config dll_config)
ADD_LINK_FLAGS_TEST(mod_config dll_config)
ADD_LINK_FLAGS_TEST(exe_config mod_config)
ADD_LINK_FLAGS_TEST(lib_flags exe_config)
ADD_LINK_FLAGS_TEST(dll_flags lib_flags)
ADD_LINK_FLAGS_TEST(mod_flags dll_flags)
ADD_LINK_FLAGS_TEST(exe_flags mod_flags)
ADD_LINK_FLAGS_TEST(lib_flags_config exe_flags)
ADD_LINK_FLAGS_TEST(dll_flags_config lib_flags_config)
ADD_LINK_FLAGS_TEST(mod_flags_config dll_flags_config)
ADD_LINK_FLAGS_TEST(exe_flags_config mod_flags_config)
# If we are running right now with a UnixMakefiles based generator,
# build the "Simple" test with the ExtraGenerators, if available

View File

@ -13,6 +13,9 @@ set_property(TARGET LinkFlags_lib PROPERTY STATIC_LIBRARY_FLAGS ${pre}BADFLAG${o
add_library(LinkFlags_dll SHARED LinkFlagsLib.c)
set_property(TARGET LinkFlags_dll PROPERTY LINK_FLAGS ${pre}BADFLAG${obj})
add_library(LinkFlags_mod MODULE LinkFlagsLib.c)
set_property(TARGET LinkFlags_mod PROPERTY LINK_FLAGS ${pre}BADFLAG${obj})
add_executable(LinkFlags_exe LinkFlagsExe.c)
set_property(TARGET LinkFlags_exe PROPERTY LINK_FLAGS ${pre}BADFLAG${obj})
@ -22,7 +25,13 @@ set_property(TARGET LinkFlags_lib_config PROPERTY STATIC_LIBRARY_FLAGS_${TEST_CO
add_library(LinkFlags_dll_config SHARED LinkFlagsLib.c)
set_property(TARGET LinkFlags_dll_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG_${TEST_CONFIG}${obj})
add_library(LinkFlags_mod_config MODULE LinkFlagsLib.c)
set_property(TARGET LinkFlags_mod_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG_${TEST_CONFIG}${obj})
add_executable(LinkFlags_exe_config LinkFlagsExe.c)
set_property(TARGET LinkFlags_exe_config PROPERTY LINK_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG_${TEST_CONFIG}${obj})
add_executable(LinkFlags LinkFlags.c)
add_subdirectory(LinkerFlags)
add_subdirectory(LinkerFlagsConfig)

View File

@ -0,0 +1,11 @@
set(CMAKE_STATIC_LINKER_FLAGS ${pre}BADFLAG${obj})
add_library(LinkFlags_lib_flags STATIC ../LinkFlagsLib.c)
set(CMAKE_SHARED_LINKER_FLAGS ${pre}BADFLAG${obj})
add_library(LinkFlags_dll_flags SHARED ../LinkFlagsLib.c)
set(CMAKE_MODULE_LINKER_FLAGS ${pre}BADFLAG${obj})
add_library(LinkFlags_mod_flags MODULE ../LinkFlagsLib.c)
set(CMAKE_EXE_LINKER_FLAGS ${pre}BADFLAG${obj})
add_executable(LinkFlags_exe_flags ../LinkFlagsExe.c)

View File

@ -0,0 +1,11 @@
set(CMAKE_STATIC_LINKER_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG${obj})
add_library(LinkFlags_lib_flags_config STATIC ../LinkFlagsLib.c)
set(CMAKE_SHARED_LINKER_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG${obj})
add_library(LinkFlags_dll_flags_config SHARED ../LinkFlagsLib.c)
set(CMAKE_MODULE_LINKER_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG${obj})
add_library(LinkFlags_mod_flags_config MODULE ../LinkFlagsLib.c)
set(CMAKE_EXE_LINKER_FLAGS_${TEST_CONFIG_UPPER} ${pre}BADFLAG${obj})
add_executable(LinkFlags_exe_flags_config ../LinkFlagsExe.c)