From 1c2aef92552aa504a05d90a5506df516b6fd171e Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Thu, 27 Jun 2024 11:00:13 -0400 Subject: [PATCH] Meta: Only build vcpkg dependencies in release mode by default We currently build debug and release versions of vcpkg dependencies. We will most commonly only need the release version, so let's default to that to approximately halve our dependency build time. --- CMakePresets.json | 3 ++- Meta/CMake/vcpkg/base-triplets/arm64-osx.cmake | 4 ++++ Meta/CMake/vcpkg/base-triplets/x64-linux.cmake | 3 +++ Meta/CMake/vcpkg/base-triplets/x64-osx.cmake | 4 ++++ Meta/CMake/vcpkg/release-triplets/arm64-osx.cmake | 2 ++ Meta/CMake/vcpkg/release-triplets/release.cmake | 2 ++ Meta/CMake/vcpkg/release-triplets/x64-linux.cmake | 2 ++ Meta/CMake/vcpkg/release-triplets/x64-osx.cmake | 2 ++ Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake | 11 ++--------- Meta/CMake/vcpkg/sanitizer-triplets/sanitizer.cmake | 4 ++++ Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake | 10 ++-------- Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake | 11 ++--------- 12 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 Meta/CMake/vcpkg/base-triplets/arm64-osx.cmake create mode 100644 Meta/CMake/vcpkg/base-triplets/x64-linux.cmake create mode 100644 Meta/CMake/vcpkg/base-triplets/x64-osx.cmake create mode 100644 Meta/CMake/vcpkg/release-triplets/arm64-osx.cmake create mode 100644 Meta/CMake/vcpkg/release-triplets/release.cmake create mode 100644 Meta/CMake/vcpkg/release-triplets/x64-linux.cmake create mode 100644 Meta/CMake/vcpkg/release-triplets/x64-osx.cmake create mode 100644 Meta/CMake/vcpkg/sanitizer-triplets/sanitizer.cmake diff --git a/CMakePresets.json b/CMakePresets.json index b83003a9ba..940e694f1d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -16,7 +16,8 @@ "CMAKE_BUILD_TYPE": "RelWithDebInfo", "SERENITY_CACHE_DIR": "${sourceDir}/Build/caches", "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/Toolchain/Tarballs/vcpkg/scripts/buildsystems/vcpkg.cmake", - "VCPKG_INSTALL_OPTIONS": "--no-print-usage" + "VCPKG_INSTALL_OPTIONS": "--no-print-usage", + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/release-triplets" }, "environment": { "LADYBIRD_SOURCE_DIR": "${sourceDir}", diff --git a/Meta/CMake/vcpkg/base-triplets/arm64-osx.cmake b/Meta/CMake/vcpkg/base-triplets/arm64-osx.cmake new file mode 100644 index 0000000000..56633d834f --- /dev/null +++ b/Meta/CMake/vcpkg/base-triplets/arm64-osx.cmake @@ -0,0 +1,4 @@ +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_OSX_ARCHITECTURES arm64) +set(VCPKG_CRT_LINKAGE dynamic) diff --git a/Meta/CMake/vcpkg/base-triplets/x64-linux.cmake b/Meta/CMake/vcpkg/base-triplets/x64-linux.cmake new file mode 100644 index 0000000000..d8eb6a0969 --- /dev/null +++ b/Meta/CMake/vcpkg/base-triplets/x64-linux.cmake @@ -0,0 +1,3 @@ +set(VCPKG_CMAKE_SYSTEM_NAME Linux) +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) diff --git a/Meta/CMake/vcpkg/base-triplets/x64-osx.cmake b/Meta/CMake/vcpkg/base-triplets/x64-osx.cmake new file mode 100644 index 0000000000..80e1a25c40 --- /dev/null +++ b/Meta/CMake/vcpkg/base-triplets/x64-osx.cmake @@ -0,0 +1,4 @@ +set(VCPKG_CMAKE_SYSTEM_NAME Darwin) +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_OSX_ARCHITECTURES x86_64) +set(VCPKG_CRT_LINKAGE dynamic) diff --git a/Meta/CMake/vcpkg/release-triplets/arm64-osx.cmake b/Meta/CMake/vcpkg/release-triplets/arm64-osx.cmake new file mode 100644 index 0000000000..83ba793a27 --- /dev/null +++ b/Meta/CMake/vcpkg/release-triplets/arm64-osx.cmake @@ -0,0 +1,2 @@ +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/arm64-osx.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/release.cmake) diff --git a/Meta/CMake/vcpkg/release-triplets/release.cmake b/Meta/CMake/vcpkg/release-triplets/release.cmake new file mode 100644 index 0000000000..d19538159a --- /dev/null +++ b/Meta/CMake/vcpkg/release-triplets/release.cmake @@ -0,0 +1,2 @@ +set(VCPKG_BUILD_TYPE release) +set(VCPKG_LIBRARY_LINKAGE static) diff --git a/Meta/CMake/vcpkg/release-triplets/x64-linux.cmake b/Meta/CMake/vcpkg/release-triplets/x64-linux.cmake new file mode 100644 index 0000000000..925fcce8da --- /dev/null +++ b/Meta/CMake/vcpkg/release-triplets/x64-linux.cmake @@ -0,0 +1,2 @@ +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-linux.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/release.cmake) diff --git a/Meta/CMake/vcpkg/release-triplets/x64-osx.cmake b/Meta/CMake/vcpkg/release-triplets/x64-osx.cmake new file mode 100644 index 0000000000..1f2d859222 --- /dev/null +++ b/Meta/CMake/vcpkg/release-triplets/x64-osx.cmake @@ -0,0 +1,2 @@ +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-osx.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/release.cmake) diff --git a/Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake b/Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake index d25fb9a6da..8d7d1ea9a7 100644 --- a/Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake +++ b/Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake @@ -1,9 +1,2 @@ -set(VCPKG_TARGET_ARCHITECTURE arm64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES arm64) - -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "-frtti") +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/arm64-osx.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/sanitizer.cmake) diff --git a/Meta/CMake/vcpkg/sanitizer-triplets/sanitizer.cmake b/Meta/CMake/vcpkg/sanitizer-triplets/sanitizer.cmake new file mode 100644 index 0000000000..b0ebad018f --- /dev/null +++ b/Meta/CMake/vcpkg/sanitizer-triplets/sanitizer.cmake @@ -0,0 +1,4 @@ +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_C_FLAGS "") +set(VCPKG_CXX_FLAGS "-frtti") diff --git a/Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake b/Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake index 1bf7c7990e..ab24df231c 100644 --- a/Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake +++ b/Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake @@ -1,8 +1,2 @@ -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) - -set(VCPKG_CMAKE_SYSTEM_NAME Linux) - -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "-frtti") +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-linux.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/sanitizer.cmake) diff --git a/Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake b/Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake index 70251f2674..107a891f23 100644 --- a/Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake +++ b/Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake @@ -1,9 +1,2 @@ -set(VCPKG_TARGET_ARCHITECTURE x64) -set(VCPKG_CRT_LINKAGE dynamic) -set(VCPKG_LIBRARY_LINKAGE static) - -set(VCPKG_CMAKE_SYSTEM_NAME Darwin) -set(VCPKG_OSX_ARCHITECTURES x86_64) - -set(VCPKG_C_FLAGS "") -set(VCPKG_CXX_FLAGS "-frtti") +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-osx.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/sanitizer.cmake)