From dfd928a8f8006f193dc8bec26657aad19c14f8f9 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Tue, 5 Nov 2024 13:59:35 -0700 Subject: [PATCH] CMake: Install simdutf runtime components as required Using install(IMPORTED_RUNTIME_ARTIFACTS), we can re-export the shared library and frameworks we imported from outside the build tree into our install treer. This is required for simdutf as it is a dependency of the AK library, and we need liblagom-ak.so to be loadable when doing fuzzer and cross-compile builds for the Lagom tools. --- AK/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AK/CMakeLists.txt b/AK/CMakeLists.txt index 49298c3483e..48eedf2ad7f 100644 --- a/AK/CMakeLists.txt +++ b/AK/CMakeLists.txt @@ -61,6 +61,14 @@ find_package(simdutf REQUIRED) swizzle_target_properties_for_swift(simdutf::simdutf) target_link_libraries(AK PRIVATE simdutf::simdutf) +# FIXME: Make this generic for all imported shared library dependencies and apply globally +if (NOT CMAKE_SKIP_INSTALL_RULES AND NOT "${VCPKG_INSTALLED_DIR}" STREQUAL "") + install(IMPORTED_RUNTIME_ARTIFACTS simdutf::simdutf + LIBRARY COMPONENT Lagom_Runtime NAMELINK_COMPONENT Lagom_Development + FRAMEWORK COMPONENT Lagom_Runtime + ) +endif() + if (ENABLE_SWIFT) generate_clang_module_map(AK GENERATED_FILES