mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
CMake: Add find module for BlocksRuntime on non-Apple platforms
This commit is contained in:
parent
be84ff4f2c
commit
72acb1111f
Notes:
github-actions[bot]
2025-03-18 23:16:18 +00:00
Author: https://github.com/ADKaster
Commit: 72acb1111f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3963
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/bugaevc
1 changed files with 19 additions and 0 deletions
19
Meta/CMake/FindBlocksRuntime.cmake
Normal file
19
Meta/CMake/FindBlocksRuntime.cmake
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Finds the BlocksRuntime library
|
||||
# On Apple platforms, this does not exist and is folded into other System libraries
|
||||
|
||||
find_library(BLOCKS_RUNTIME NAMES BlocksRuntime
|
||||
PATHS ${SWIFT_LIBRARY_SEARCH_PATHS}
|
||||
)
|
||||
if (BLOCKS_RUNTIME)
|
||||
if (NOT TARGET BlocksRuntime::BlocksRuntime)
|
||||
add_library(BlocksRuntime::BlocksRuntime IMPORTED UNKNOWN)
|
||||
message(STATUS "Found BlocksRuntime: ${BLOCKS_RUNTIME}")
|
||||
cmake_path(GET BLOCKS_RUNTIME PARENT_PATH _BLOCKS_RUNTIME_DIR)
|
||||
set_target_properties(BlocksRuntime::BlocksRuntime PROPERTIES
|
||||
IMPORTED_LOCATION "${BLOCKS_RUNTIME}"
|
||||
INTERFACE_LINK_DIRECTORIES "${_BLOCKS_RUNTIME_DIR}"
|
||||
INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:C,CXX>:-fblocks>;SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xcc -fblocks>"
|
||||
)
|
||||
endif()
|
||||
set(BlocksRuntime_FOUND TRUE)
|
||||
endif()
|
Loading…
Add table
Add a link
Reference in a new issue