Merge pull request #957 from simdjson/dlemire/install_just_lib

This might enable folks to just build the library.
This commit is contained in:
Daniel Lemire 2020-06-23 09:12:28 -04:00 committed by GitHub
commit aa4340ef5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 17 deletions

View File

@ -83,14 +83,13 @@ commands:
- run: | - run: |
cd build && cd build &&
cmake $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination .. && cmake $CMAKE_FLAGS -DCMAKE_INSTALL_PREFIX:PATH=destination .. &&
make $BUILD_FLAGS all && make $BUILD_FLAGS all
tools/json2json -h # Print out the implementation we're using on this hardware
cmake_test: cmake_test:
steps: steps:
- cmake_build - cmake_build
- run: | - run: |
cd build && cd build && tools/json2json -h &&
ctest $CTEST_FLAGS -L acceptance && ctest $CTEST_FLAGS -L acceptance &&
ctest $CTEST_FLAGS -LE acceptance -E checkperf ctest $CTEST_FLAGS -LE acceptance -E checkperf
@ -98,7 +97,7 @@ commands:
steps: steps:
- cmake_build - cmake_build
- run: | - run: |
cd build && cd build && tools/json2json -h &&
ctest $CTEST_FLAGS -L acceptance -LE per_implementation && ctest $CTEST_FLAGS -L acceptance -LE per_implementation &&
SIMDJSON_FORCE_IMPLEMENTATION=haswell ctest $CTEST_FLAGS -L per_implementation && SIMDJSON_FORCE_IMPLEMENTATION=haswell ctest $CTEST_FLAGS -L per_implementation &&
SIMDJSON_FORCE_IMPLEMENTATION=westmere ctest $CTEST_FLAGS -L per_implementation &&SIMDJSON_FORCE_IMPLEMENTATION=fallback ctest $CTEST_FLAGS -L per_implementation && 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:
executor: gcc7 executor: gcc7
environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=ON } environment: { CMAKE_FLAGS: -DSIMDJSON_GOOGLE_BENCHMARKS=ON }
steps: [ install_cmake, cmake_test, cmake_install_test ] steps: [ install_cmake, cmake_test, cmake_install_test ]
justlib-gcc10:
description: Build just the library, install it and do a basic test
executor: gcc10
environment: { CMAKE_FLAGS: -SIMDJSON_JUST_LIBRARY=ON }
steps: [ cmake_build, cmake_install_test ]
gcc10: gcc10:
description: Build and run tests on GCC 10 and AVX 2 with a cmake static build description: Build and run tests on GCC 10 and AVX 2 with a cmake static build
executor: gcc10 executor: gcc10
@ -238,6 +242,9 @@ workflows:
- arch-haswell-gcc10 - arch-haswell-gcc10
- arch-nehalem-gcc10 - arch-nehalem-gcc10
- no-computed-goto-gcc10 - no-computed-goto-gcc10
# testing "just the library"
- justlib-gcc10
# TODO add windows: https://circleci.com/docs/2.0/configuration-reference/#windows # TODO add windows: https://circleci.com/docs/2.0/configuration-reference/#windows

View File

@ -16,14 +16,20 @@ include(GNUInstallDirs)
include(simdjson-flags.cmake) include(simdjson-flags.cmake)
include(simdjson-user-cmakecache.cmake) include(simdjson-user-cmakecache.cmake)
if(SIMDJSON_JUST_LIBRARY)
MESSAGE( STATUS "Building just the library, omitting all tests, tools and benchmarks." )
endif()
# #
# Set up test data # Set up test data
# #
enable_testing() if(NOT(SIMDJSON_JUST_LIBRARY))
add_subdirectory(jsonchecker) enable_testing()
add_subdirectory(jsonexamples) add_subdirectory(jsonchecker)
add_library(test-data INTERFACE) add_subdirectory(jsonexamples)
target_link_libraries(test-data INTERFACE jsonchecker-data jsonexamples-data) add_library(test-data INTERFACE)
target_link_libraries(test-data INTERFACE jsonchecker-data jsonexamples-data)
endif()
# #
# Create the top level simdjson library (must be done at this level to use both src/ and include/ # 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)
add_subdirectory(include) add_subdirectory(include)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(windows) add_subdirectory(windows)
add_subdirectory(tools) if(NOT(SIMDJSON_JUST_LIBRARY))
add_subdirectory(singleheader) add_subdirectory(tools)
add_subdirectory(singleheader)
endif()
# #
# Compile tools / tests / benchmarks # Compile tools / tests / benchmarks
# #
add_subdirectory(dependencies) if(NOT(SIMDJSON_JUST_LIBRARY))
add_subdirectory(tests) add_subdirectory(dependencies)
add_subdirectory(examples) add_subdirectory(tests)
add_subdirectory(benchmark) add_subdirectory(examples)
add_subdirectory(fuzz) add_subdirectory(benchmark)
add_subdirectory(fuzz)
endif()
# #
# Source files should be just ASCII # Source files should be just ASCII

View File

@ -1,4 +1,4 @@
option(SIMDJSON_JUST_LIBRARY "Build just the library, omit tests, tools and benchmarks" OFF)
# #
# Flags used by exes and by the simdjson library (project-wide flags) # Flags used by exes and by the simdjson library (project-wide flags)
# #