mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
CMake: Add helper to swiftify imported properties from dependencies
Works around https://gitlab.kitware.com/cmake/cmake/-/issues/26195
This commit is contained in:
committed by
Andrew Kaster
parent
756ef2c722
commit
7f0044a721
@@ -58,6 +58,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(simdutf REQUIRED)
|
find_package(simdutf REQUIRED)
|
||||||
|
swizzle_target_properties_for_swift(simdutf::simdutf)
|
||||||
target_link_libraries(AK PRIVATE simdutf::simdutf)
|
target_link_libraries(AK PRIVATE simdutf::simdutf)
|
||||||
|
|
||||||
if (ENABLE_SWIFT)
|
if (ENABLE_SWIFT)
|
||||||
|
|||||||
@@ -22,3 +22,16 @@ add_compile_options("SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -std=c++23 -cxx-inte
|
|||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(CMAKE_Swift_COMPILER_TARGET "${CMAKE_SYSTEM_PROCESSOR}-apple-macosx${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
set(CMAKE_Swift_COMPILER_TARGET "${CMAKE_SYSTEM_PROCESSOR}-apple-macosx${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# FIXME: https://gitlab.kitware.com/cmake/cmake/-/issues/26195
|
||||||
|
# For now, we'll just manually massage the flags.
|
||||||
|
function(swizzle_target_properties_for_swift target_name)
|
||||||
|
get_property(compile_options TARGET ${target_name} PROPERTY INTERFACE_COMPILE_OPTIONS)
|
||||||
|
set(munged_properties "")
|
||||||
|
foreach(property IN LISTS compile_options)
|
||||||
|
set(cxx_property "$<$<COMPILE_LANGUAGE:C,CXX,ASM>:${property}>")
|
||||||
|
set(swift_property "SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc ${property}>")
|
||||||
|
list(APPEND munged_properties "${cxx_property}" "${swift_property}")
|
||||||
|
endforeach()
|
||||||
|
set_property(TARGET ${target_name} PROPERTY INTERFACE_COMPILE_OPTIONS ${munged_properties})
|
||||||
|
endfunction()
|
||||||
|
|||||||
@@ -252,3 +252,8 @@ function(add_lagom_library_install_rules target_name)
|
|||||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
if (NOT COMMAND swizzle_target_properties_for_swift)
|
||||||
|
function(swizzle_target_properties_for_swift target)
|
||||||
|
endfunction()
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user