diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2015-08-24 18:33:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-21 14:12:13 (GMT) |
commit | 9784af1b50a142c0160058734c7e12cee5f2a15e (patch) | |
tree | 864a958bf6accb58c6d9de434e1675f4addd38b7 /Tests/RunCMake/CMP0065/subproject | |
parent | 402bf096ec4aac75af096c3708ce51efaf4589d0 (diff) | |
download | CMake-9784af1b50a142c0160058734c7e12cee5f2a15e.zip CMake-9784af1b50a142c0160058734c7e12cee5f2a15e.tar.gz CMake-9784af1b50a142c0160058734c7e12cee5f2a15e.tar.bz2 |
CMP0065: Restrict the use of CMAKE_SHARED_LIBRARY_LINK_<LANG>_FLAGS
This new policy restricts the addition of the shared library link flags
to executables only when the ENABLE_EXPORTS property is set to True.
Diffstat (limited to 'Tests/RunCMake/CMP0065/subproject')
-rw-r--r-- | Tests/RunCMake/CMP0065/subproject/CMakeLists.txt | 22 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0065/subproject/main.c | 7 |
2 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt new file mode 100644 index 0000000..bed5960 --- /dev/null +++ b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.3) + +project(TestPolicyCMP0065 C) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS BADFLAGS) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 OLD) +add_executable(FooOLDBad1 main.c) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 OLD) +add_executable(FooOLDBad2 main.c) +set_target_properties(FooOLDBad2 PROPERTIES ENABLE_EXPORTS ON) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 NEW) +add_executable(FooNEWGood main.c) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 NEW) +add_executable(FooNEWBad main.c) +set_target_properties(FooNEWBad PROPERTIES ENABLE_EXPORTS ON) diff --git a/Tests/RunCMake/CMP0065/subproject/main.c b/Tests/RunCMake/CMP0065/subproject/main.c new file mode 100644 index 0000000..98725db --- /dev/null +++ b/Tests/RunCMake/CMP0065/subproject/main.c @@ -0,0 +1,7 @@ +#include <stdio.h> + +int main(int argc, char **argv) +{ + printf("Hello World\n"); + return 0; +} |