mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 19:00:54 -06:00
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
This commit is contained in:
@@ -2683,7 +2683,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
||||
if (emitted.insert(frameworkDir).second) {
|
||||
std::string incpath = this->XCodeEscapePath(frameworkDir);
|
||||
if (emitSystemIncludes &&
|
||||
gtgt->IsSystemIncludeDirectory(frameworkDir, configName,
|
||||
gtgt->IsSystemIncludeDirectory(include, configName,
|
||||
langForPreprocessor)) {
|
||||
sysfdirs.Add(incpath);
|
||||
} else {
|
||||
|
||||
8
Tests/RunCMake/Framework/FrameworkSystemIncludeTest.c
Normal file
8
Tests/RunCMake/Framework/FrameworkSystemIncludeTest.c
Normal file
@@ -0,0 +1,8 @@
|
||||
#include <Example/Example.h>
|
||||
|
||||
int foo(void);
|
||||
|
||||
int foo(void)
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
12
Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake
Normal file
12
Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake
Normal file
@@ -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)
|
||||
@@ -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()
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#pragma GCC warning "This should be suppressed"
|
||||
Reference in New Issue
Block a user