mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
CMake: Create a set of vcpkg overlay triplets for sanitizers
This changes the Sanitizer configs to build all the vcpkg dependencies with our specified CFLAGS and CXXFLAGS for ASAN and UBSAN. Unfortunately, we can't yet enable actually compiling them with sanitizers enabled, because this causes test failures that need to be investigated.
This commit is contained in:
parent
b88e0eb50a
commit
bf3c11229f
Notes:
sideshowbarker
2024-07-16 23:34:49 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/bf3c11229f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/190
6 changed files with 36 additions and 6 deletions
6
.github/actions/setup/action.yml
vendored
6
.github/actions/setup/action.yml
vendored
|
@ -17,10 +17,6 @@ runs:
|
|||
if: ${{ inputs.os == 'Linux' }}
|
||||
shell: bash
|
||||
run: |
|
||||
# These packages are already part of the ubuntu-22.04 image:
|
||||
# cmake libgmp-dev npm shellcheck
|
||||
# Packages below aren't.
|
||||
|
||||
set -e
|
||||
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
|
@ -29,7 +25,7 @@ runs:
|
|||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install autoconf autoconf-archive automake ccache clang-18 clang++-18 lld-18 gcc-13 g++-13 libstdc++-13-dev ninja-build unzip qt6-base-dev qt6-tools-dev-tools libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev libpulse-dev libssl-dev libegl1-mesa-dev
|
||||
sudo apt-get install autoconf autoconf-archive automake build-essential cmake fonts-liberation2 zip curl tar ccache clang-18 clang++-18 lld-18 gcc-13 g++-13 libstdc++-13-dev ninja-build unzip qt6-base-dev qt6-tools-dev-tools libqt6svg6-dev qt6-multimedia-dev libgl1-mesa-dev libpulse-dev libssl-dev libegl1-mesa-dev
|
||||
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
|
||||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
|
||||
|
|
7
.github/workflows/lagom-template.yml
vendored
7
.github/workflows/lagom-template.yml
vendored
|
@ -76,6 +76,13 @@ jobs:
|
|||
echo "host_cxx=$(brew --prefix llvm@18)/bin/clang++" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Set dynamic environment variables
|
||||
id: 'set-env-vars'
|
||||
run: |
|
||||
# Note: Required for vcpkg to use this compiler for its own builds.
|
||||
echo "CC=${{ steps.build-parameters.outputs.host_cc }}" >> "$GITHUB_ENV"
|
||||
echo "CXX=${{ steps.build-parameters.outputs.host_cxx }}" >> "$GITHUB_ENV"
|
||||
|
||||
# https://github.com/actions/runner-images/issues/9330
|
||||
- name: Enable Microphone Access (macOS 14)
|
||||
if: ${{ inputs.os == 'macos-14' }}
|
||||
|
|
|
@ -46,7 +46,8 @@
|
|||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug",
|
||||
"ENABLE_UNDEFINED_SANITIZER": "ON",
|
||||
"ENABLE_ADDRESS_SANITIZER": "ON"
|
||||
"ENABLE_ADDRESS_SANITIZER": "ON",
|
||||
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/sanitizer-triplets"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
9
Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake
Normal file
9
Meta/CMake/vcpkg/sanitizer-triplets/arm64-osx.cmake
Normal file
|
@ -0,0 +1,9 @@
|
|||
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")
|
8
Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake
Normal file
8
Meta/CMake/vcpkg/sanitizer-triplets/x64-linux.cmake
Normal file
|
@ -0,0 +1,8 @@
|
|||
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")
|
9
Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake
Normal file
9
Meta/CMake/vcpkg/sanitizer-triplets/x64-osx.cmake
Normal file
|
@ -0,0 +1,9 @@
|
|||
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")
|
Loading…
Reference in a new issue