diff options
Diffstat (limited to 'Tests/RunCMake/set_property')
-rw-r--r-- | Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake | 73 | ||||
-rw-r--r-- | Tests/RunCMake/set_property/LinkStatic.c | 5 | ||||
-rw-r--r-- | Tests/RunCMake/set_property/RunCMakeTest.cmake | 1 |
3 files changed, 79 insertions, 0 deletions
diff --git a/Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake b/Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake new file mode 100644 index 0000000..70d2fee --- /dev/null +++ b/Tests/RunCMake/set_property/LINK_SEARCH_STATIC.cmake @@ -0,0 +1,73 @@ +project(LinkSearchStatic) + +set(CMAKE_LINK_SEARCH_START_STATIC ON) +add_executable(LinkSearchStartStaticInit1 LinkStatic.c) +get_target_property(LSSS LinkSearchStartStaticInit1 + LINK_SEARCH_START_STATIC) +if(NOT LSSS) + message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_START_STATIC") +endif() +unset(CMAKE_LINK_SEARCH_START_STATIC) + +add_executable(LinkSearchStartStaticSet1 LinkStatic.c) +set_target_properties(LinkSearchStartStaticSet1 PROPERTIES + LINK_SEARCH_START_STATIC ON) +get_target_property(LSSS LinkSearchStartStaticSet1 + LINK_SEARCH_START_STATIC) +if(NOT LSSS) + message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_START_STATIC") +endif() + +set(CMAKE_LINK_SEARCH_START_STATIC OFF) +add_executable(LinkSearchStartStaticInit2 LinkStatic.c) +get_target_property(LSSS LinkSearchStartStaticInit2 + LINK_SEARCH_START_STATIC) +if(LSSS) + message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_START_STATIC") +endif() +unset(CMAKE_LINK_SEARCH_START_STATIC) + +add_executable(LinkSearchStartStaticSet2 LinkStatic.c) +set_target_properties(LinkSearchStartStaticSet2 PROPERTIES + LINK_SEARCH_START_STATIC OFF) +get_target_property(LSSS LinkSearchStartStaticSet2 + LINK_SEARCH_START_STATIC) +if(LSSS) + message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_START_STATIC") +endif() + +set(CMAKE_LINK_SEARCH_END_STATIC ON) +add_executable(LinkSearchEndStaticInit1 LinkStatic.c) +get_target_property(LSES LinkSearchEndStaticInit1 + LINK_SEARCH_END_STATIC) +if(NOT LSES) + message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_END_STATIC") +endif() +unset(CMAKE_LINK_SEARCH_END_STATIC) + +add_executable(LinkSearchEndStaticSet1 LinkStatic.c) +set_target_properties(LinkSearchEndStaticSet1 PROPERTIES + LINK_SEARCH_END_STATIC ON) +get_target_property(LSSS LinkSearchEndStaticSet1 + LINK_SEARCH_END_STATIC) +if(NOT LSSS) + message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_END_STATIC") +endif() + +set(CMAKE_LINK_SEARCH_END_STATIC OFF) +add_executable(LinkSearchEndStaticInit2 LinkStatic.c) +get_target_property(LSES LinkSearchEndStaticInit2 + LINK_SEARCH_END_STATIC) +if(LSES) + message(FATAL_ERROR "Failed to correctly initialize LINK_SEARCH_END_STATIC") +endif() +unset(CMAKE_LINK_SEARCH_END_STATIC) + +add_executable(LinkSearchEndStaticSet2 LinkStatic.c) +set_target_properties(LinkSearchEndStaticSet2 PROPERTIES + LINK_SEARCH_END_STATIC ON) +get_target_property(LSSS LinkSearchEndStaticSet2 + LINK_SEARCH_END_STATIC) +if(NOT LSSS) + message(FATAL_ERROR "Failed to correctly set LINK_SEARCH_END_STATIC") +endif() diff --git a/Tests/RunCMake/set_property/LinkStatic.c b/Tests/RunCMake/set_property/LinkStatic.c new file mode 100644 index 0000000..3600977 --- /dev/null +++ b/Tests/RunCMake/set_property/LinkStatic.c @@ -0,0 +1,5 @@ +#include <math.h> +int main(void) +{ + return (int)sin(0); +} diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake index 54e63f7..ada8804 100644 --- a/Tests/RunCMake/set_property/RunCMakeTest.cmake +++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake @@ -1,3 +1,4 @@ include(RunCMake) run_cmake(LINK_LIBRARIES) +run_cmake(LINK_SEARCH_STATIC) |