diff options
author | Brad King <brad.king@kitware.com> | 2022-01-06 15:12:03 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-06 15:12:26 (GMT) |
commit | ac892a64a93054f27dfd84d99af01ac68aa617d7 (patch) | |
tree | 55c05e45b8b7bed3c3553a5350629455fa171eaa /Tests | |
parent | 2f244b4cb82e4a91162d2965a0cea6da12359665 (diff) | |
parent | 7d99cff236af619a7f1d8275575cd27050809322 (diff) | |
download | CMake-ac892a64a93054f27dfd84d99af01ac68aa617d7.zip CMake-ac892a64a93054f27dfd84d99af01ac68aa617d7.tar.gz CMake-ac892a64a93054f27dfd84d99af01ac68aa617d7.tar.bz2 |
Merge topic 'xcode-framework-system-includes'
7d99cff236 Xcode: Properly identify frameworks with system includes
Acked-by: Kitware Robot <kwrobot@kitware.com>
Tested-by: buildbot <buildbot@kitware.com>
Merge-request: !6815
Diffstat (limited to 'Tests')
5 files changed, 33 insertions, 0 deletions
diff --git a/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.c b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.c new file mode 100644 index 0000000..644a978 --- /dev/null +++ b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.c @@ -0,0 +1,8 @@ +#include <Example/Example.h> + +int foo(void); + +int foo(void) +{ + return 42; +} diff --git a/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake new file mode 100644 index 0000000..d172281 --- /dev/null +++ b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake @@ -0,0 +1,12 @@ +enable_language(C) + +add_library(Example::Example SHARED IMPORTED) +set_target_properties(Example::Example PROPERTIES + FRAMEWORK 1 + IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/subdir/Example.framework/Example.tbd" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/subdir/Example.framework;${CMAKE_CURRENT_SOURCE_DIR}/subdir/Example.framework/Headers" +) + +add_library(testcase FrameworkSystemIncludeTest.c) +target_compile_options(testcase PRIVATE "-Werror=#pragma-messages") +target_link_libraries(testcase PRIVATE Example::Example) diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake index 36eaf5c..2f8fdc7 100644 --- a/Tests/RunCMake/Framework/RunCMakeTest.cmake +++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake @@ -93,3 +93,15 @@ function(imported_framework_test) endfunction() imported_framework_test() + +function(framework_system_include_test) + set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/FrameworkSystemIncludeTest-build") + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + run_cmake(FrameworkSystemIncludeTest) + run_cmake_command(FrameworkSystemIncludeTest-build ${CMAKE_COMMAND} --build .) +endfunction() + +framework_system_include_test() diff --git a/Tests/RunCMake/Framework/subdir/Example.framework/Example.tbd b/Tests/RunCMake/Framework/subdir/Example.framework/Example.tbd new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/Framework/subdir/Example.framework/Example.tbd diff --git a/Tests/RunCMake/Framework/subdir/Example.framework/Headers/Example.h b/Tests/RunCMake/Framework/subdir/Example.framework/Headers/Example.h new file mode 100644 index 0000000..92cdb70 --- /dev/null +++ b/Tests/RunCMake/Framework/subdir/Example.framework/Headers/Example.h @@ -0,0 +1 @@ +#pragma GCC warning "This should be suppressed" |