From 227c95ed7603c19636d4cd569fcf4739647afb09 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Sat, 26 Aug 2023 10:30:25 +0300 Subject: [PATCH] Add ninja build --- .github/scripts/python.sh | 1 + .github/scripts/unix.sh | 1 + .github/workflows/build-linux.yml | 2 +- .github/workflows/build-python.yml | 2 +- .github/workflows/build-special.yml | 2 +- .github/workflows/build-windows.yml | 10 +++++++++- 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/scripts/python.sh b/.github/scripts/python.sh index de073759b4..c72e9abd6c 100644 --- a/.github/scripts/python.sh +++ b/.github/scripts/python.sh @@ -45,6 +45,7 @@ function install_dependencies() function build() { + export CMAKE_GENERATOR=Ninja BUILD_PYBIND="ON" cmake $GITHUB_WORKSPACE \ -B build \ diff --git a/.github/scripts/unix.sh b/.github/scripts/unix.sh index 05d969d402..09fcd788bf 100644 --- a/.github/scripts/unix.sh +++ b/.github/scripts/unix.sh @@ -37,6 +37,7 @@ function configure() # GTSAM_BUILD_WITH_MARCH_NATIVE=OFF: to avoid crashes in builder VMs # CMAKE_CXX_FLAGS="-w": Suppress warnings to avoid IO latency in CI logs + export CMAKE_GENERATOR=Ninja cmake $GITHUB_WORKSPACE \ -B build \ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-Debug} \ diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index e4937ce065..5de09c63f6 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -73,7 +73,7 @@ jobs: fi sudo apt-get -y update - sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev + sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev ninja-build if [ "${{ matrix.compiler }}" = "gcc" ]; then sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index ca4645a77d..480c791dc6 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -75,7 +75,7 @@ jobs: fi sudo apt-get -y update - sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libboost-all-dev + sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libboost-all-dev ninja-build if [ "${{ matrix.compiler }}" = "gcc" ]; then sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib diff --git a/.github/workflows/build-special.yml b/.github/workflows/build-special.yml index 72466ffd68..164646e3e1 100644 --- a/.github/workflows/build-special.yml +++ b/.github/workflows/build-special.yml @@ -103,7 +103,7 @@ jobs: sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main" fi - sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev + sudo apt-get -y install cmake build-essential pkg-config libpython3-dev python3-numpy libicu-dev ninja-build if [ "${{ matrix.compiler }}" = "gcc" ]; then sudo apt-get install -y g++-${{ matrix.version }} g++-${{ matrix.version }}-multilib diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 670d87b3f1..a1d232b2a4 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -100,9 +100,17 @@ jobs: arch: x${{ matrix.platform }} - name: Configuration + shell: bash run: | + export CMAKE_GENERATOR=Ninja cmake -E remove_directory build - cmake -G Ninja -B build -S . -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF -DBOOST_ROOT="${env:BOOST_ROOT}" -DBOOST_INCLUDEDIR="${env:BOOST_ROOT}\boost\include" -DBOOST_LIBRARYDIR="${env:BOOST_ROOT}\lib" + cmake -B build \ + -S . \ + -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \ + -DGTSAM_ALLOW_DEPRECATED_SINCE_V43=OFF \ + -DBOOST_ROOT="${BOOST_ROOT}" \ + -DBOOST_INCLUDEDIR="${BOOST_ROOT}\boost\include" \ + -DBOOST_LIBRARYDIR="${BOOST_ROOT}\lib" - name: Build shell: bash