ci(codeql): migrate builds to ninja (#3250)

This commit is contained in:
ReenigneArcher
2024-10-01 21:12:40 -04:00
committed by GitHub
parent 9cc8bc8f62
commit 024bd8f8b6
4 changed files with 41 additions and 54 deletions

View File

@ -5,33 +5,31 @@ set -e
pacman --noconfirm -Syu
# install dependencies
pacman -S --noconfirm \
base-devel \
diffutils \
gcc \
git \
make \
mingw-w64-ucrt-x86_64-cmake \
mingw-w64-ucrt-x86_64-cppwinrt \
mingw-w64-ucrt-x86_64-curl-winssl \
mingw-w64-ucrt-x86_64-graphviz \
mingw-w64-ucrt-x86_64-miniupnpc \
mingw-w64-ucrt-x86_64-nlohmann-json \
mingw-w64-ucrt-x86_64-nodejs \
mingw-w64-ucrt-x86_64-nsis \
mingw-w64-ucrt-x86_64-onevpl \
mingw-w64-ucrt-x86_64-openssl \
mingw-w64-ucrt-x86_64-opus \
mingw-w64-ucrt-x86_64-rust \
mingw-w64-ucrt-x86_64-toolchain
dependencies=(
"git"
"mingw-w64-ucrt-x86_64-cmake"
"mingw-w64-ucrt-x86_64-cppwinrt"
"mingw-w64-ucrt-x86_64-curl-winssl"
"mingw-w64-ucrt-x86_64-miniupnpc"
"mingw-w64-ucrt-x86_64-nlohmann-json"
"mingw-w64-ucrt-x86_64-nodejs"
"mingw-w64-ucrt-x86_64-nsis"
"mingw-w64-ucrt-x86_64-onevpl"
"mingw-w64-ucrt-x86_64-openssl"
"mingw-w64-ucrt-x86_64-opus"
"mingw-w64-ucrt-x86_64-toolchain"
)
pacman -S --noconfirm "${dependencies[@]}"
# build
mkdir -p build
cd build || exit 1
cmake \
-B build \
-G Ninja \
-S . \
-DBUILD_DOCS=OFF \
-G "MinGW Makefiles" ..
mingw32-make -j"$(nproc)"
-DBUILD_WERROR=ON
ninja -C build
# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"

View File

@ -2,22 +2,28 @@
set -e
# install dependencies
brew install \
boost \
cmake \
miniupnpc \
node \
opus \
pkg-config
dependencies=(
"boost"
"cmake"
"miniupnpc"
"ninja"
"node"
"openssl@3"
"opus"
"pkg-config"
)
brew install "${dependencies[@]}"
# build
mkdir -p build
cd build || exit 1
cmake \
-B build \
-G Ninja \
-S . \
-DBOOST_USE_STATIC=OFF \
-DBUILD_DOCS=OFF \
-G "Unix Makefiles" ..
make -j"$(sysctl -n hw.logicalcpu)"
-DBUILD_WERROR=ON
ninja -C build
# skip autobuild
echo "skip_autobuild=true" >> "$GITHUB_OUTPUT"

View File

@ -34,12 +34,13 @@ dependencies=(
"graphviz" # Optional, for docs
"icu4c" # Optional, if boost is not installed
"miniupnpc"
"ninja"
"node"
"openssl@3"
"opus"
"pkg-config"
)
brew install ${dependencies[@]}
brew install "${dependencies[@]}"
```
If there are issues with an SSL header that is not found:
@ -63,10 +64,11 @@ dependencies=(
"graphviz" # Optional, for docs
"libopus"
"miniupnpc"
"ninja"
"npm9"
"pkgconfig"
)
sudo port install ${dependencies[@]}
sudo port install "${dependencies[@]}"
```
#### Windows
@ -97,7 +99,7 @@ dependencies=(
"mingw-w64-ucrt-x86_64-opus"
"mingw-w64-ucrt-x86_64-toolchain"
)
pacman -S ${dependencies[@]}
pacman -S "${dependencies[@]}"
```
### Clone

View File

@ -1,19 +0,0 @@
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
#SET(CMAKE_SYSROOT ${CMAKE_FIND_ROOT_PATH})
#SET(CMAKE_EXE_LINKER_FLAGS "-static ${CMAKE_EXE_LINKER_FLAGS}")
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)