From b6dcf3edf362cf43bb823947b0c9344a20e80f36 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 10 Dec 2022 22:01:08 +0100 Subject: [PATCH] :green_heart: fix Ubuntu build --- .github/workflows/ubuntu.yml | 2 +- cmake/ci.cmake | 32 +++++++++++--------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5c13b61c2..b00d7f8e3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -90,7 +90,7 @@ jobs: target: [ci_cmake_flags, ci_test_diagnostics, ci_test_noexceptions, ci_test_noimplicitconversions, ci_test_legacycomparison, ci_test_noglobaludls] steps: - name: Install build-essential - run: apt-get update ; apt-get install -y build-essential unzip clang wget lib32z1 + run: apt-get update ; apt-get install -y build-essential unzip clang wget - uses: actions/checkout@v3 - name: Get latest CMake and ninja uses: lukka/get-cmake@latest diff --git a/cmake/ci.cmake b/cmake/ci.cmake index 874dda7e1..f3c4a1e8f 100644 --- a/cmake/ci.cmake +++ b/cmake/ci.cmake @@ -836,27 +836,17 @@ add_custom_target(ci_benchmarks ############################################################################### function(ci_get_cmake version var) - if (APPLE) - set(${var} ${PROJECT_BINARY_DIR}/cmake-${version}-Darwin64/CMake.app/Contents/bin/cmake) - add_custom_command( - OUTPUT ${${var}} - COMMAND wget -nc https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-Darwin64.tar.gz - COMMAND tar xfz cmake-${version}-Darwin64.tar.gz - COMMAND rm cmake-${version}-Darwin64.tar.gz - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMENT "Download CMake ${version}" - ) - else() - set(${var} ${PROJECT_BINARY_DIR}/cmake-${version}-Linux-x86_64/bin/cmake) - add_custom_command( - OUTPUT ${${var}} - COMMAND wget -nc https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-Linux-x86_64.tar.gz - COMMAND tar xfz cmake-${version}-Linux-x86_64.tar.gz - COMMAND rm cmake-${version}-Linux-x86_64.tar.gz - WORKING_DIRECTORY ${PROJECT_BINARY_DIR} - COMMENT "Download CMake ${version}" - ) - endif() + set(${var} ${PROJECT_BINARY_DIR}/cmake-${version}/bin/cmake) + add_custom_command( + OUTPUT ${${var}} + COMMAND wget -nc https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}.tar.gz + COMMAND tar xfz cmake-${version}.tar.gz + COMMAND rm cmake-${version}.tar.gz + COMMAND ${CMAKE_COMMAND} -S cmake-${version} -B cmake-${version} + COMMAND ${CMAKE_COMMAND} --build cmake-${version} --parallel 10 + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + COMMENT "Download CMake ${version}" + ) set(${var} ${${var}} PARENT_SCOPE) endfunction()