Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing git check #828

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 9 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/[email protected]")
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
Expand All @@ -57,26 +56,18 @@ 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.")
endif()
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.")
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
Loading