@@ -16,14 +16,20 @@ include(GNUInstallDirs)
1616include (simdjson-flags.cmake )
1717include (simdjson-user-cmakecache.cmake )
1818
19+ if (SIMDJSON_JUST_LIBRARY)
20+ MESSAGE ( STATUS "Building just the library, omitting all tests, tools and benchmarks." )
21+ endif ()
22+
1923#
2024# Set up test data
2125#
22- enable_testing ()
23- add_subdirectory (jsonchecker )
24- add_subdirectory (jsonexamples )
25- add_library (test -data INTERFACE )
26- target_link_libraries (test -data INTERFACE jsonchecker-data jsonexamples-data )
26+ if (NOT (SIMDJSON_JUST_LIBRARY))
27+ enable_testing ()
28+ add_subdirectory (jsonchecker )
29+ add_subdirectory (jsonexamples )
30+ add_library (test -data INTERFACE )
31+ target_link_libraries (test -data INTERFACE jsonchecker-data jsonexamples-data )
32+ endif ()
2733
2834#
2935# Create the top level simdjson library (must be done at this level to use both src/ and include/
@@ -32,17 +38,21 @@ target_link_libraries(test-data INTERFACE jsonchecker-data jsonexamples-data)
3238add_subdirectory (include )
3339add_subdirectory (src )
3440add_subdirectory (windows )
35- add_subdirectory (tools )
36- add_subdirectory (singleheader )
41+ if (NOT (SIMDJSON_JUST_LIBRARY))
42+ add_subdirectory (tools )
43+ add_subdirectory (singleheader )
44+ endif ()
3745
3846#
3947# Compile tools / tests / benchmarks
4048#
41- add_subdirectory (dependencies )
42- add_subdirectory (tests )
43- add_subdirectory (examples )
44- add_subdirectory (benchmark )
45- add_subdirectory (fuzz )
49+ if (NOT (SIMDJSON_JUST_LIBRARY))
50+ add_subdirectory (dependencies )
51+ add_subdirectory (tests )
52+ add_subdirectory (examples )
53+ add_subdirectory (benchmark )
54+ add_subdirectory (fuzz )
55+ endif ()
4656
4757#
4858# Source files should be just ASCII
0 commit comments