mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Meta: Add a CPack installation target for js(1)
This adds a CPack configuration to generate a release package for js(1). Our current CMake requirement is 3.16, which doesn't have a great story for automatically installing a binary target's library dependencies. If we eventually require CMake 3.21 or above, we can remove the helper .cmake file added here in lieu of RUNTIME_DEPENDENCIES.
This commit is contained in:
parent
a05d25d4e5
commit
636a6a2fb8
Notes:
sideshowbarker
2024-07-17 19:07:02 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/636a6a2fb8 Pull-request: https://github.com/SerenityOS/serenity/pull/12344 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/IdanHo Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/davidot
2 changed files with 51 additions and 3 deletions
|
@ -304,7 +304,7 @@ if (BUILD_LAGOM)
|
|||
)
|
||||
|
||||
# ELF
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# for Lagom on Apple M1
|
||||
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
file(GLOB LIBELF_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibELF/*.cpp")
|
||||
|
@ -462,7 +462,7 @@ if (BUILD_LAGOM)
|
|||
)
|
||||
|
||||
# x86
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# for Lagom on Apple M1
|
||||
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
file(GLOB LIBX86_SOURCES CONFIGURE_DEPENDS "../../Userland/Libraries/LibX86/*.cpp")
|
||||
|
@ -484,7 +484,7 @@ if (BUILD_LAGOM)
|
|||
set_target_properties(adjtime_lagom PROPERTIES OUTPUT_NAME adjtime)
|
||||
target_link_libraries(adjtime_lagom LagomCore LagomMain)
|
||||
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# FIXME: Excluding arm64 is a temporary hack to circumvent a build problem
|
||||
# for Lagom on Apple M1
|
||||
if (NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
add_executable(disasm_lagom ../../Userland/Utilities/disasm.cpp)
|
||||
|
@ -658,6 +658,20 @@ if (BUILD_LAGOM)
|
|||
PASS_REGULAR_EXPRESSION "PASS"
|
||||
)
|
||||
endforeach()
|
||||
|
||||
# FIXME: When we are using CMake >= 3.21, the library installations can be replaced with RUNTIME_DEPENDENCIES.
|
||||
# https://cmake.org/cmake/help/latest/command/install.html
|
||||
include(get_linked_lagom_libraries.cmake)
|
||||
get_linked_lagom_libraries(js_lagom js_lagom_libraries)
|
||||
|
||||
install(TARGETS js_lagom ${js_lagom_libraries} COMPONENT js)
|
||||
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
set(CPACK_STRIP_FILES TRUE)
|
||||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||
set(CPACK_COMPONENTS_ALL js)
|
||||
set(CPACK_PACKAGE_FILE_NAME serenity-js)
|
||||
include(CPack)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
|
34
Meta/Lagom/get_linked_lagom_libraries.cmake
Normal file
34
Meta/Lagom/get_linked_lagom_libraries.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
function(add_lagom_library list item)
|
||||
list(FIND "${list}" "${item}" item_is_present)
|
||||
|
||||
if (item_is_present EQUAL -1)
|
||||
set("${list}" "${${list}}" "${item}" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(get_linked_lagom_libraries_impl target output)
|
||||
if (NOT TARGET "${target}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_target_property(target_type "${target}" TYPE)
|
||||
|
||||
if ("${target_type}" STREQUAL "SHARED_LIBRARY")
|
||||
add_lagom_library("${output}" "${target}")
|
||||
elseif ("${target_type}" STREQUAL "INTERFACE_LIBRARY")
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_target_property(target_libraries "${target}" LINK_LIBRARIES)
|
||||
|
||||
foreach(target_library IN LISTS target_libraries)
|
||||
get_linked_lagom_libraries_impl("${target_library}" "${output}")
|
||||
endforeach()
|
||||
|
||||
set("${output}" "${${output}}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(get_linked_lagom_libraries target output)
|
||||
get_linked_lagom_libraries_impl(${target} ${output})
|
||||
set("${output}" "${${output}}" PARENT_SCOPE)
|
||||
endfunction()
|
Loading…
Add table
Reference in a new issue