File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,8 +16,16 @@ include(GNUInstallDirs)
1616include (cmake/simdjson-flags.cmake )
1717include (cmake/simdjson-user-cmakecache.cmake )
1818
19+ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR } /.git)
20+ set (SIMDJSON_IS_UNDER_GIT ON CACHE BOOL "Whether cmake is under git control" )
21+ message ( STATUS "The simdjson repository appears to be under git." )
22+ else ()
23+ set (SIMDJSON_IS_UNDER_GIT OFF CACHE BOOL "Whether cmake is under git control" )
24+ message ( STATUS "The simdjson repository does not appear to be under git." )
25+ endif ()
26+
1927if (SIMDJSON_JUST_LIBRARY)
20- MESSAGE ( STATUS "Building just the library, omitting all tests, tools and benchmarks." )
28+ message ( STATUS "Building just the library, omitting all tests, tools and benchmarks." )
2129endif ()
2230
2331#
Original file line number Diff line number Diff line change 77
88# Clone the repository if it's not there
99find_package (Git QUIET )
10- if (Git_FOUND AND (GIT_VERSION_STRING VERSION_GREATER "2.1.4" )) # We use "-C" which requires a recent git
10+ if (SIMDJSON_IS_UNDER_GIT AND Git_FOUND AND (GIT_VERSION_STRING VERSION_GREATER "2.1.4" )) # We use "-C" which requires a recent git
1111 message (STATUS "Git is available and it is recent. We are enabling checkperf targets." )
1212 # sync_git_repository(myrepo ...) creates two targets:
1313 # myrepo - if the repo does not exist, creates and syncs it against the origin branch
Original file line number Diff line number Diff line change 22
33
44find_package (Git QUIET ) # We want the library to build even if git is missing
5- if (Git_FOUND)
5+ if (( Git_FOUND) AND (SIMDJSON_IS_UNDER_GIT) )
66 message (STATUS "Git is available." )
77 # Does NOT attempt to update or otherwise modify git submodules that are already initialized.
88 function (initialize_submodule DIRECTORY )
You can’t perform that action at this time.
0 commit comments