Skip to content

Commit ce5581d

Browse files
author
Daniel Lemire
committed
This makes it so that if we are under someone else, we just build the library.
1 parent 5b4acf1 commit ce5581d

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

cmake/simdjson-flags.cmake

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
option(SIMDJSON_JUST_LIBRARY "Build just the library, omit tests, tools and benchmarks" OFF)
1+
2+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
3+
message (STATUS "The simdjson repository appears to be standalone.")
4+
option(SIMDJSON_JUST_LIBRARY "Build just the library, omit tests, tools and benchmarks" OFF)
5+
message (STATUS "By default, we attempt to build everything.")
6+
else()
7+
message (STATUS "The simdjson repository appears to be used as a subdirectory.")
8+
option(SIMDJSON_JUST_LIBRARY "Build just the library, omit tests, tools and benchmarks" ON)
9+
message (STATUS "By default, we just build the library.")
10+
endif()
11+
12+
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
13+
set(SIMDJSON_IS_UNDER_GIT ON CACHE BOOL "Whether cmake is under git control")
14+
message( STATUS "The simdjson repository appears to be under git." )
15+
else()
16+
set(SIMDJSON_IS_UNDER_GIT OFF CACHE BOOL "Whether cmake is under git control")
17+
message( STATUS "The simdjson repository does not appear to be under git." )
18+
endif()
219

320
#
421
# Flags used by exes and by the simdjson library (project-wide flags)

0 commit comments

Comments
 (0)