Meta: Support fully static distribution release builds

This adds the vcpkg triplets and CMake preset to perform release
builds for distribution. These builds are fully static, and currently
intended to be used for the `js` ESVU release.

In the future, linking everything statically into the final binary is
probably not what we will do for released Ladybird builds. Instead, we
may have a "libladybird.so", which is then linked into the binary. But
this should be fine for `js` for now.
This commit is contained in:
Timothy Flynn 2024-11-08 08:11:50 -05:00 committed by Andrew Kaster
parent e53e1d3586
commit 0447d05d52
Notes: github-actions[bot] 2024-11-08 18:30:29 +00:00
7 changed files with 32 additions and 1 deletions

View file

@ -62,7 +62,7 @@ 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 "")
if (BUILD_SHARED_LIBS AND 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

View file

@ -87,6 +87,18 @@
"generator": "Visual Studio 17 2022",
"toolset": "ClangCL"
},
{
"name": "Distribution",
"inherits": "default",
"displayName": "Distribution Config",
"description": "Distribution build with static libraries using Ninja generator",
"binaryDir": "${fileDir}/Build/distribution",
"cacheVariables": {
"BUILD_SHARED_LIBS": "OFF",
"CMAKE_BUILD_TYPE": "Release",
"VCPKG_OVERLAY_TRIPLETS": "${fileDir}/Meta/CMake/vcpkg/distribution-triplets"
}
},
{
"name": "Debug",
"inherits": "default",
@ -126,6 +138,15 @@
],
"displayName": "Non-Sanitizer CI Config"
},
{
"name": "Distribution_CI",
"inherits": [
"vcpkg_ci",
"Distribution"
],
"displayName": "Distribution CI Config",
"description": "Distribution build with GitHub Actions cache"
},
{
"name": "Sanitizer_CI",
"inherits": [

View file

@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/arm64-linux.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/distribution.cmake)

View file

@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/arm64-osx.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/distribution.cmake)

View file

@ -0,0 +1,2 @@
set(VCPKG_BUILD_TYPE release)
set(VCPKG_LIBRARY_LINKAGE static)

View file

@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-linux.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/distribution.cmake)

View file

@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-osx.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/distribution.cmake)