mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-01 19:30:13 -06:00
Extend the change from commit dfaf55fbfd (Xcode: add extra
'$(inherited)' entries using InheritBuildSettingAttribute, 2021-05-03,
v3.21.0-rc1~182^2) to cover Swift flags and compilation conditions,
allowing CocoaPods and CMake to interoperate when used in the same
project.
14 lines
389 B
CMake
14 lines
389 B
CMake
enable_language(C)
|
|
if(CMake_TEST_Swift)
|
|
enable_language(Swift)
|
|
string(APPEND CMAKE_Swift_FLAGS " -DSWIFTFLAG")
|
|
add_executable(swift_inherit_test dummy_main.swift)
|
|
endif()
|
|
|
|
add_compile_definitions(TEST_INHERITTEST)
|
|
string(APPEND CMAKE_C_FLAGS " -DTESTFLAG=\\\"TEST_INHERITTEST\\\"")
|
|
|
|
add_executable(inherit_test main.c)
|
|
|
|
target_link_libraries(inherit_test PRIVATE "TEST_INHERITTEST")
|