Skip to content

Commit 7ebe5c4

Browse files
committed
This might enable folks to just build the library.
1 parent c25928e commit 7ebe5c4

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

.circleci/config.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,21 @@ commands:
8383
- run: |
8484
cd build &&
8585
cmake $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination .. &&
86-
make $BUILD_FLAGS all &&
87-
tools/json2json -h # Print out the implementation we're using on this hardware
86+
make $BUILD_FLAGS all
8887
8988
cmake_test:
9089
steps:
9190
- cmake_build
9291
- run: |
93-
cd build &&
92+
cd build && tools/json2json -h &&
9493
ctest $CTEST_FLAGS -L acceptance &&
9594
ctest $CTEST_FLAGS -LE acceptance -E checkperf
9695
9796
cmake_test_all:
9897
steps:
9998
- cmake_build
10099
- run: |
101-
cd build &&
100+
cd build && tools/json2json -h &&
102101
ctest $CTEST_FLAGS -L acceptance -LE per_implementation &&
103102
SIMDJSON_FORCE_IMPLEMENTATION=haswell ctest $CTEST_FLAGS -L per_implementation &&
104103
SIMDJSON_FORCE_IMPLEMENTATION=westmere ctest $CTEST_FLAGS -L per_implementation &&SIMDJSON_FORCE_IMPLEMENTATION=fallback ctest $CTEST_FLAGS -L per_implementation &&
@@ -119,6 +118,11 @@ jobs:
119118
executor: gcc7
120119
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=ON }
121120
steps: [ install_cmake, cmake_test, cmake_install_test ]
121+
gcc10justlib:
122+
description: Build just the library, install it and do a basic test
123+
executor: gcc10
124+
environment: { CMAKE_FLAGS: -SIMDJSON_JUST_LIBRARY=ON }
125+
steps: [ cmake_build, cmake_install_test ]
122126
gcc10:
123127
description: Build and run tests on GCC 10 and AVX 2 with a cmake static build
124128
executor: gcc10

CMakeLists.txt

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ include(GNUInstallDirs)
1616
include(simdjson-flags.cmake)
1717
include(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)
3238
add_subdirectory(include)
3339
add_subdirectory(src)
3440
add_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

simdjson-flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
option(SIMDJSON_JUST_LIBRARY "Buld just the library, omit tests, tools and benchmarks" OFF)
22
#
33
# Flags used by exes and by the simdjson library (project-wide flags)
44
#

0 commit comments

Comments
 (0)