CMake: Rename our triplets to their canonical names
Some checks are pending
CI / path-changes (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Blocked by required conditions
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Blocked by required conditions
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Blocked by required conditions
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Blocked by required conditions
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / path-changes (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Blocked by required conditions
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Blocked by required conditions
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Blocked by required conditions
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Blocked by required conditions
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Becuase we're using dynamic libraries, our configuration is classified as a "community triplet". To not confuse vcpkg maintainers when developers create bug reports, name them properly. This means that the default triplet detection is now kind of useless, so we have to invent our own for these triplets.
This commit is contained in:
parent
89061dd3c4
commit
673537b26b
Notes:
github-actions[bot]
2024-12-22 22:49:21 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/673537b26bb Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2767
15 changed files with 54 additions and 1 deletions
2
.github/workflows/lagom-template.yml
vendored
2
.github/workflows/lagom-template.yml
vendored
|
@ -123,7 +123,7 @@ jobs:
|
|||
run: |
|
||||
set -e
|
||||
|
||||
cmake --preset=CI -S Meta/Lagom -B ${{ github.workspace }}/Build/tools-build \
|
||||
cmake --preset=Distribution_CI -S Meta/Lagom -B ${{ github.workspace }}/Build/tools-build \
|
||||
-DLAGOM_TOOLS_ONLY=ON \
|
||||
-DINSTALL_LAGOM_TOOLS=ON \
|
||||
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Build/tools-install \
|
||||
|
|
|
@ -165,8 +165,10 @@
|
|||
"description": "Fuzzers build",
|
||||
"binaryDir": "${fileDir}/Build/fuzzers",
|
||||
"cacheVariables": {
|
||||
"BUILD_SHARED_LIBS": "OFF",
|
||||
"CMAKE_BUILD_TYPE": "",
|
||||
"ENABLE_QT": "OFF",
|
||||
"VCPKG_OVERLAY_TRIPLETS": "${fileDir}/Meta/CMake/vcpkg/distribution-triplets",
|
||||
"ENABLE_FUZZERS_LIBFUZZER": "ON",
|
||||
"ENABLE_ADDRESS_SANITIZER": "ON"
|
||||
}
|
||||
|
|
|
@ -18,3 +18,54 @@ if (LINUX AND NOT LAGOM_USE_LINKER)
|
|||
endif()
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/build-vcpkg-variables.cmake" "${EXTRA_VCPKG_VARIABLES}")
|
||||
|
||||
# Munge the VCPKG_TRIPLET to correspond to the right one for our presets
|
||||
# Just make sure not to override if the developer is trying to cross-compile
|
||||
# or the developer set it manually, or if this is not the first run of CMake
|
||||
if (NOT DEFINED CACHE{VCPKG_TARGET_TRIPLET} AND NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
|
||||
# Only tweak settings if there's custom triplets defined
|
||||
if (NOT DEFINED CACHE{VCPKG_OVERLAY_TRIPLETS})
|
||||
return()
|
||||
endif()
|
||||
|
||||
# And then, only tweak settings if the triplets are ours
|
||||
if (NOT VCPKG_OVERLAY_TRIPLETS MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(arch "")
|
||||
set(os "")
|
||||
|
||||
# The CMake way to do uname -{m,s} checks
|
||||
cmake_host_system_information(RESULT os_platform QUERY OS_PLATFORM)
|
||||
cmake_host_system_information(RESULT os_name QUERY OS_NAME)
|
||||
|
||||
if(os_platform MATCHES "^(x86_64|AMD64|amd64)$")
|
||||
set(arch x64)
|
||||
elseif(os_platform MATCHES "^(aarch64|arm64|ARM64)$")
|
||||
set(arch arm64)
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to automatically detect architecture for vcpkg, please set VCPKG_TARGET_TRIPLET manually")
|
||||
endif()
|
||||
|
||||
if (os_name STREQUAL "Linux")
|
||||
set(os linux)
|
||||
elseif (os_name MATCHES "Darwin|macOS")
|
||||
set(os osx)
|
||||
else()
|
||||
message(FATAL_ERROR "Unable to automatically detect os name for vcpkg, please set VCPKG_TARGET_TRIPLET manually")
|
||||
endif()
|
||||
|
||||
set(full_triplet "${arch}-${os}")
|
||||
|
||||
# NOTE: This will break if we start putting a trailing / on the triplet paths :|
|
||||
cmake_path(GET VCPKG_OVERLAY_TRIPLETS FILENAME triplet_path)
|
||||
string(REPLACE "-triplets" "" triplet_path ${triplet_path})
|
||||
string(TOLOWER ${triplet_path} triplet_path)
|
||||
if (NOT triplet_path STREQUAL "distribution")
|
||||
set(full_triplet "${full_triplet}-dynamic")
|
||||
endif()
|
||||
|
||||
message(STATUS "Determined host VCPKG_TARGET_TRIPLET: ${full_triplet}")
|
||||
set(VCPKG_TARGET_TRIPLET ${full_triplet} CACHE STRING "")
|
||||
endif()
|
||||
|
|
Loading…
Add table
Reference in a new issue