Skip to content

Commit

Permalink
💚 fix Ubuntu build
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Dec 10, 2022
1 parent 07182eb commit b6dcf3e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 11 additions & 21 deletions cmake/ci.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b6dcf3e

Please sign in to comment.