Skip to content

Commit 63a65f1

Browse files
authored
removing git check (#828)
1 parent 390b23b commit 63a65f1

File tree

2 files changed

+17
-22
lines changed

2 files changed

+17
-22
lines changed

CMakeLists.txt

+9-22
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ option(ADA_TESTING "Build tests" OFF)
2929
if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS)
3030
include(cmake/CPM.cmake)
3131
# CPM requires git as an implicit dependency
32-
find_package(Git QUIET)
3332
# We use googletest in the tests
34-
if(Git_FOUND AND ADA_TESTING)
33+
if(ADA_TESTING)
3534
CPMAddPackage(
3635
NAME GTest
3736
GITHUB_REPOSITORY google/googletest
@@ -40,11 +39,11 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS)
4039
)
4140
endif()
4241
# We use simdjson in both the benchmarks and tests
43-
if(Git_FOUND AND (ADA_TESTING OR ADA_BENCHMARKS))
42+
if(ADA_TESTING OR ADA_BENCHMARKS)
4443
CPMAddPackage("gh:simdjson/[email protected]")
4544
endif()
4645
# We use Google Benchmark, but it does not build under several 32-bit systems.
47-
if(Git_FOUND AND ADA_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
46+
if(ADA_BENCHMARKS AND (CMAKE_SIZEOF_VOID_P EQUAL 8))
4847
CPMAddPackage(
4948
NAME benchmark
5049
GITHUB_REPOSITORY google/benchmark
@@ -57,26 +56,18 @@ if(ADA_TESTING OR ADA_BENCHMARKS OR ADA_TOOLS)
5756
endif()
5857

5958
if (ADA_TESTING AND NOT EMSCRIPTEN)
60-
if(Git_FOUND)
61-
set(CTEST_TEST_TIMEOUT 5)
62-
message(STATUS "The tests are enabled.")
63-
add_subdirectory(tests)
64-
else()
65-
message(STATUS "The tests are disabled because git was not found.")
66-
endif()
59+
set(CTEST_TEST_TIMEOUT 5)
60+
message(STATUS "The tests are enabled.")
61+
add_subdirectory(tests)
6762
else()
6863
if(is_top_project)
6964
message(STATUS "The tests are disabled.")
7065
endif()
7166
endif(ADA_TESTING AND NOT EMSCRIPTEN)
7267

7368
If(ADA_BENCHMARKS AND NOT EMSCRIPTEN)
74-
if(Git_FOUND)
75-
message(STATUS "Ada benchmarks enabled.")
76-
add_subdirectory(benchmarks)
77-
else()
78-
message(STATUS "The benchmarks are disabled because git was not found.")
79-
endif()
69+
message(STATUS "Ada benchmarks enabled.")
70+
add_subdirectory(benchmarks)
8071
else(ADA_BENCHMARKS AND NOT EMSCRIPTEN)
8172
if(is_top_project)
8273
message(STATUS "Ada benchmarks disabled. Set ADA_BENCHMARKS=ON to enable them.")
@@ -106,11 +97,7 @@ if(NOT ADA_COVERAGE AND NOT EMSCRIPTEN)
10697
endif()
10798

10899
if(ADA_TOOLS)
109-
if(Git_FOUND)
110-
add_subdirectory(tools)
111-
else()
112-
message(STATUS "The tools are disabled because git was not found.")
113-
endif()
100+
add_subdirectory(tools)
114101
endif()
115102

116103
install(

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,16 @@ With tests (requires git):
324324
- **Build**: `cmake -B build -DADA_TESTING=ON && cmake --build build`
325325
- **Test**: `ctest --output-on-failure --test-dir build`
326326
327+
328+
With tests (requires available local packages):
329+
330+
- **Build**: `cmake -B build -DADA_TESTING=ON -D CPM_USE_LOCAL_PACKAGES=ON && cmake --build build`
331+
- **Test**: `ctest --output-on-failure --test-dir build`
332+
327333
Windows users need additional flags to specify the build configuration, e.g. `--config Release`.
328334
335+
336+
329337
The project can also be built via docker using default docker file of repository with following commands.
330338
331339
`docker build -t ada-builder . && docker run --rm -it -v ${PWD}:/repo ada-builder`

0 commit comments

Comments
 (0)