From 63a65f1080f87c88904b576850282f72f7174d92 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Sun, 5 Jan 2025 14:23:55 -0500 Subject: [PATCH] removing git check (#828) --- CMakeLists.txt | 31 +++++++++---------------------- README.md | 8 ++++++++ 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2c0850b..54d49a591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,8 @@ option(ADA_TESTING "Build tests" OFF) if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) include(cmake/CPM.cmake) # CPM requires git as an implicit dependency - find_package(Git QUIET) # We use googletest in the tests - if(Git_FOUND AND ADA_TESTING) + if(ADA_TESTING) CPMAddPackage( NAME GTest GITHUB_REPOSITORY google/googletest @@ -40,11 +39,11 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) ) endif() # We use simdjson in both the benchmarks and tests - if(Git_FOUND AND (ADA_TESTING OR ADA_BENCHMARKS)) + if(ADA_TESTING OR ADA_BENCHMARKS) CPMAddPackage("gh:simdjson/simdjson@3.10.1") endif() # We use Google Benchmark, but it does not build under several 32-bit systems. - if(Git_FOUND AND ADA_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) + if(ADA_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8)) CPMAddPackage( NAME benchmark GITHUB_REPOSITORY google/benchmark @@ -57,13 +56,9 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) endif() if (ADA_TESTING AND NOT EMSCRIPTEN) - if(Git_FOUND) - set(CTEST_TEST_TIMEOUT 5) - message(STATUS "The tests are enabled.") - add_subdirectory(tests) - else() - message(STATUS "The tests are disabled because git was not found.") - endif() + set(CTEST_TEST_TIMEOUT 5) + message(STATUS "The tests are enabled.") + add_subdirectory(tests) else() if(is_top_project) message(STATUS "The tests are disabled.") @@ -71,12 +66,8 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS) endif(ADA_TESTING AND NOT EMSCRIPTEN) If(ADA_BENCHMARKS AND NOT EMSCRIPTEN) - if(Git_FOUND) - message(STATUS "Ada benchmarks enabled.") - add_subdirectory(benchmarks) - else() - message(STATUS "The benchmarks are disabled because git was not found.") - endif() + message(STATUS "Ada benchmarks enabled.") + add_subdirectory(benchmarks) else(ADA_BENCHMARKS AND NOT EMSCRIPTEN) if(is_top_project) message(STATUS "Ada benchmarks disabled. Set ADA_BENCHMARKS=ON to enable them.") @@ -106,11 +97,7 @@ if(NOT ADA_COVERAGE AND NOT EMSCRIPTEN) endif() if(ADA_TOOLS) - if(Git_FOUND) - add_subdirectory(tools) - else() - message(STATUS "The tools are disabled because git was not found.") - endif() + add_subdirectory(tools) endif() install( diff --git a/README.md b/README.md index 48009e334..b28f24560 100644 --- a/README.md +++ b/README.md @@ -324,8 +324,16 @@ With tests (requires git): - **Build**: `cmake -B build -DADA_TESTING=ON && cmake --build build` - **Test**: `ctest --output-on-failure --test-dir build` + +With tests (requires available local packages): + +- **Build**: `cmake -B build -DADA_TESTING=ON -D CPM_USE_LOCAL_PACKAGES=ON && cmake --build build` +- **Test**: `ctest --output-on-failure --test-dir build` + Windows users need additional flags to specify the build configuration, e.g. `--config Release`. + + The project can also be built via docker using default docker file of repository with following commands. `docker build -t ada-builder . && docker run --rm -it -v ${PWD}:/repo ada-builder`