forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |