diff options
author | Brad King <brad.king@kitware.com> | 2023-09-22 13:06:27 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-09-22 13:07:11 (GMT) |
commit | 2dafd1f09227915197eb268cac6affdb37a24647 (patch) | |
tree | 5294dcb92f8fa8b90d5f378e1d6e2650f5170ff5 /Tests | |
parent | af888a07f8e3ab7d6a736b5a5a129a1d808474e5 (diff) | |
parent | 3bdf95f942c8532fb1e0fbad52f04f46e822b2f9 (diff) | |
download | CMake-2dafd1f09227915197eb268cac6affdb37a24647.zip CMake-2dafd1f09227915197eb268cac6affdb37a24647.tar.gz CMake-2dafd1f09227915197eb268cac6affdb37a24647.tar.bz2 |
Merge topic 'macOS-system-framework-link'
3bdf95f942 macOS: GNU toolchain: ensure framework, marked as SYSTEM, can be linked
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8825
Diffstat (limited to 'Tests')
4 files changed, 20 insertions, 13 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 62c9628..2eccb2a 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -710,10 +710,11 @@ if(XCODE_VERSION) set_property(TEST RunCMake.XcodeProject PROPERTY TIMEOUT ${CMake_TEST_XcodeProject_TIMEOUT}) endif() -if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" +if((CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 6.0) - add_RunCMake_test(Framework) - if(NOT DEFINED CMake_TEST_XcFramework) + OR (APPLE AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)) + add_RunCMake_test(Framework -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}) + if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT DEFINED CMake_TEST_XcFramework) set(CMake_TEST_XcFramework ON) endif() if(CMake_TEST_XcFramework AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 11.0) diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json index 6d320f4..a4c13a8 100644 --- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json +++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/apple_exe_framework.json @@ -34,7 +34,7 @@ "lto": null, "commandFragments": [ { - "fragment": "-iframework .+/framework(/(Debug|Release|RelWithDebInfo|MinSizeRel))?\"? -iframework /usr/Frameworks$", + "fragment": "-F.+/framework(/(Debug|Release|RelWithDebInfo|MinSizeRel))?\"? -F/usr/Frameworks$", "role": "frameworkPath", "backtrace": null }, diff --git a/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake index 94c0b87..b50a8ad 100644 --- a/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake +++ b/Tests/RunCMake/Framework/FrameworkSystemIncludeTest.cmake @@ -8,7 +8,7 @@ set_target_properties(Example::Example PROPERTIES ) add_library(testcase FrameworkSystemIncludeTest.c) -target_compile_options(testcase PRIVATE "-Werror=#pragma-messages") +target_compile_options(testcase PRIVATE "$<IF:$<C_COMPILER_ID:GNU>,-Werror,-Werror=#pragma-messages>") target_link_libraries(testcase PRIVATE Example::Example) @@ -20,7 +20,7 @@ set_target_properties(Example::Example2 PROPERTIES ) add_library(testcase2 FrameworkSystemIncludeTest.c) -target_compile_options(testcase2 PRIVATE "-Werror=#pragma-messages") +target_compile_options(testcase2 PRIVATE "$<IF:$<C_COMPILER_ID:GNU>,-Werror,-Werror=#pragma-messages>") target_link_libraries(testcase2 PRIVATE Example::Example2) @@ -32,5 +32,5 @@ set_target_properties(Example::Example3 PROPERTIES ) add_library(testcase3 FrameworkSystemIncludeTest.c) -target_compile_options(testcase3 PRIVATE "-Werror=#pragma-messages") +target_compile_options(testcase3 PRIVATE "$<IF:$<C_COMPILER_ID:GNU>,-Werror,-Werror=#pragma-messages>") target_link_libraries(testcase3 PRIVATE Example::Example3) diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake index 7319a59..2c5b46f 100644 --- a/Tests/RunCMake/Framework/RunCMakeTest.cmake +++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake @@ -15,8 +15,10 @@ function(framework_layout_test Name Toolchain Type) run_cmake_command(${Name} ${CMAKE_COMMAND} --build .) endfunction() -framework_layout_test(iOSFrameworkLayout-build ios SHARED) -framework_layout_test(iOSFrameworkLayout-build ios STATIC) +if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") + framework_layout_test(iOSFrameworkLayout-build ios SHARED) + framework_layout_test(iOSFrameworkLayout-build ios STATIC) +endif() framework_layout_test(OSXFrameworkLayout-build osx SHARED) framework_layout_test(OSXFrameworkLayout-build osx STATIC) @@ -36,13 +38,17 @@ function(framework_type_test Toolchain Type UseProperty) run_cmake_command(FrameworkType${Type}-build ${CMAKE_COMMAND} --build .) endfunction() -framework_type_test(ios SHARED NO) -framework_type_test(ios STATIC NO) +if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") + framework_type_test(ios SHARED NO) + framework_type_test(ios STATIC NO) +endif() framework_type_test(osx SHARED NO) framework_type_test(osx STATIC NO) -framework_type_test(ios SHARED YES) -framework_type_test(ios STATIC YES) +if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU") + framework_type_test(ios SHARED YES) + framework_type_test(ios STATIC YES) +endif() framework_type_test(osx SHARED YES) framework_type_test(osx STATIC YES) |