This removes git as a dependency
This commit is contained in:
parent
e01f1434fb
commit
cb8a9ef2c0
|
@ -14,13 +14,13 @@ target_compile_definitions(parse_nonumberparsing PRIVATE SIMDJSON_SKIPNUMBERPARS
|
|||
add_executable(parse_nostringparsing parse.cpp)
|
||||
target_compile_definitions(parse_nostringparsing PRIVATE SIMDJSON_SKIPSTRINGPARSING)
|
||||
|
||||
if (SIMDJSON_GOOGLE_BENCHMARKS)
|
||||
if (TARGET benchmark::benchmark)
|
||||
link_libraries(benchmark::benchmark)
|
||||
add_executable(bench_parse_call bench_parse_call.cpp)
|
||||
add_executable(bench_dom_api bench_dom_api.cpp)
|
||||
endif()
|
||||
|
||||
if (SIMDJSON_COMPETITION)
|
||||
if (TARGET competition-all)
|
||||
add_executable(distinctuseridcompetition distinctuseridcompetition.cpp)
|
||||
target_link_libraries(distinctuseridcompetition competition-core)
|
||||
add_executable(minifiercompetition minifiercompetition.cpp)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
# Clone the repository if it's not there
|
||||
find_package(Git QUIET)
|
||||
if (Git_FOUND)
|
||||
if (Git_FOUND AND (GIT_VERSION_STRING VERSION_GREATER "2.1.4")) # We use "-C" which requires a recent git
|
||||
# sync_git_repository(myrepo ...) creates two targets:
|
||||
# myrepo - if the repo does not exist, creates and syncs it against the origin branch
|
||||
# update_myrepo - will update the repo against the origin branch (and create if needed)
|
||||
|
@ -92,4 +92,4 @@ if (Git_FOUND)
|
|||
set_property(TEST checkperf APPEND PROPERTY DEPENDS parse perfdiff ${SIMDJSON_USER_CMAKECACHE})
|
||||
set_property(TEST checkperf PROPERTY RUN_SERIAL TRUE)
|
||||
|
||||
endif (Git_FOUND)
|
||||
endif ()
|
||||
|
|
|
@ -1,74 +1,79 @@
|
|||
# Initializes a git submodule if it hasn't been initialized before
|
||||
# Does NOT attempt to update or otherwise modify git submodules that are already initialized.
|
||||
function(initialize_submodule DIRECTORY)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/.git)
|
||||
find_package(Git QUIET REQUIRED)
|
||||
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/.git does not exist. Initializing ${DIRECTORY} submodule ...")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_EXIT_CODE)
|
||||
if(NOT GIT_EXIT_CODE EQUAL "0")
|
||||
message(FATAL_ERROR "${GIT_EXECUTABLE} submodule update --init dependencies/${DIRECTORY} failed with exit code ${GIT_EXIT_CODE}, please checkout submodules")
|
||||
|
||||
|
||||
find_package(Git QUIET) # We want the library to build even if git is missing
|
||||
if (Git_FOUND)
|
||||
# Does NOT attempt to update or otherwise modify git submodules that are already initialized.
|
||||
function(initialize_submodule DIRECTORY)
|
||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/.git)
|
||||
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}/.git does not exist. Initializing ${DIRECTORY} submodule ...")
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init ${CMAKE_CURRENT_SOURCE_DIR}/${DIRECTORY}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_EXIT_CODE)
|
||||
if(NOT GIT_EXIT_CODE EQUAL "0")
|
||||
message(FATAL_ERROR "${GIT_EXECUTABLE} submodule update --init dependencies/${DIRECTORY} failed with exit code ${GIT_EXIT_CODE}, please checkout submodules")
|
||||
endif()
|
||||
endif()
|
||||
endfunction(initialize_submodule)
|
||||
|
||||
if (SIMDJSON_GOOGLE_BENCHMARKS)
|
||||
option(BENCHMARK_ENABLE_TESTING OFF)
|
||||
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||
option(BENCHMARK_ENABLE_INSTALL OFF)
|
||||
set(BENCHMARK_ENABLE_INSTALL OFF)
|
||||
initialize_submodule(benchmark)
|
||||
add_subdirectory(benchmark)
|
||||
endif()
|
||||
endfunction(initialize_submodule)
|
||||
|
||||
if (SIMDJSON_GOOGLE_BENCHMARKS)
|
||||
option(BENCHMARK_ENABLE_TESTING OFF)
|
||||
set(BENCHMARK_ENABLE_TESTING OFF)
|
||||
option(BENCHMARK_ENABLE_INSTALL OFF)
|
||||
set(BENCHMARK_ENABLE_INSTALL OFF)
|
||||
initialize_submodule(benchmark)
|
||||
add_subdirectory(benchmark)
|
||||
endif()
|
||||
if (SIMDJSON_COMPETITION)
|
||||
initialize_submodule(cJSON)
|
||||
add_library(competition-cJSON INTERFACE)
|
||||
target_include_directories(competition-cJSON INTERFACE cJSON)
|
||||
|
||||
if (SIMDJSON_COMPETITION)
|
||||
initialize_submodule(cJSON)
|
||||
add_library(competition-cJSON INTERFACE)
|
||||
target_include_directories(competition-cJSON INTERFACE cJSON)
|
||||
initialize_submodule(fastjson)
|
||||
add_library(competition-fastjson INTERFACE)
|
||||
target_include_directories(competition-fastjson INTERFACE fastjson/src fastjson/include)
|
||||
|
||||
initialize_submodule(fastjson)
|
||||
add_library(competition-fastjson INTERFACE)
|
||||
target_include_directories(competition-fastjson INTERFACE fastjson/src fastjson/include)
|
||||
initialize_submodule(gason)
|
||||
add_library(competition-gason INTERFACE)
|
||||
target_include_directories(competition-gason INTERFACE gason/src)
|
||||
|
||||
initialize_submodule(gason)
|
||||
add_library(competition-gason INTERFACE)
|
||||
target_include_directories(competition-gason INTERFACE gason/src)
|
||||
initialize_submodule(jsmn)
|
||||
add_library(competition-jsmn INTERFACE)
|
||||
target_include_directories(competition-jsmn INTERFACE jsmn)
|
||||
|
||||
initialize_submodule(jsmn)
|
||||
add_library(competition-jsmn INTERFACE)
|
||||
target_include_directories(competition-jsmn INTERFACE jsmn)
|
||||
initialize_submodule(json)
|
||||
add_library(competition-json INTERFACE)
|
||||
target_include_directories(competition-json INTERFACE json/single_include)
|
||||
|
||||
initialize_submodule(json)
|
||||
add_library(competition-json INTERFACE)
|
||||
target_include_directories(competition-json INTERFACE json/single_include)
|
||||
initialize_submodule(json11)
|
||||
add_library(competition-json11 INTERFACE)
|
||||
target_include_directories(competition-json11 INTERFACE json11)
|
||||
|
||||
initialize_submodule(json11)
|
||||
add_library(competition-json11 INTERFACE)
|
||||
target_include_directories(competition-json11 INTERFACE json11)
|
||||
add_library(competition-jsoncppdist INTERFACE)
|
||||
target_include_directories(competition-jsoncppdist INTERFACE jsoncppdist)
|
||||
|
||||
add_library(competition-jsoncppdist INTERFACE)
|
||||
target_include_directories(competition-jsoncppdist INTERFACE jsoncppdist)
|
||||
initialize_submodule(rapidjson)
|
||||
add_library(competition-rapidjson INTERFACE)
|
||||
target_include_directories(competition-rapidjson INTERFACE rapidjson/include)
|
||||
|
||||
initialize_submodule(rapidjson)
|
||||
add_library(competition-rapidjson INTERFACE)
|
||||
target_include_directories(competition-rapidjson INTERFACE rapidjson/include)
|
||||
initialize_submodule(sajson)
|
||||
add_library(competition-sajson INTERFACE)
|
||||
target_include_directories(competition-sajson INTERFACE sajson/include)
|
||||
|
||||
initialize_submodule(sajson)
|
||||
add_library(competition-sajson INTERFACE)
|
||||
target_include_directories(competition-sajson INTERFACE sajson/include)
|
||||
initialize_submodule(ujson4c)
|
||||
add_library(competition-ujson4c ujson4c/src/ujdecode.c)
|
||||
target_include_directories(competition-ujson4c PUBLIC ujson4c/3rdparty ujson4c/src)
|
||||
|
||||
initialize_submodule(ujson4c)
|
||||
add_library(competition-ujson4c ujson4c/src/ujdecode.c)
|
||||
target_include_directories(competition-ujson4c PUBLIC ujson4c/3rdparty ujson4c/src)
|
||||
add_library(competition-core INTERFACE)
|
||||
target_link_libraries(competition-core INTERFACE competition-json competition-rapidjson competition-sajson competition-cJSON competition-jsmn)
|
||||
|
||||
add_library(competition-core INTERFACE)
|
||||
target_link_libraries(competition-core INTERFACE competition-json competition-rapidjson competition-sajson competition-cJSON competition-jsmn)
|
||||
add_library(competition-all INTERFACE)
|
||||
target_link_libraries(competition-all INTERFACE competition-core competition-jsoncppdist competition-json11 competition-fastjson competition-gason competition-ujson4c)
|
||||
endif()
|
||||
|
||||
add_library(competition-all INTERFACE)
|
||||
target_link_libraries(competition-all INTERFACE competition-core competition-jsoncppdist competition-json11 competition-fastjson competition-gason competition-ujson4c)
|
||||
endif()
|
||||
initialize_submodule(cxxopts)
|
||||
add_library(cxxopts INTERFACE)
|
||||
target_include_directories(cxxopts INTERFACE cxxopts/include)
|
||||
|
||||
initialize_submodule(cxxopts)
|
||||
add_library(cxxopts INTERFACE)
|
||||
target_include_directories(cxxopts INTERFACE cxxopts/include)
|
||||
endif()
|
|
@ -64,7 +64,7 @@ find_program(BASH bash)
|
|||
|
||||
|
||||
# Script tests
|
||||
if (BASH AND (NOT MSVC)) # The scripts are not robust enough to run under Windows even if bash is available
|
||||
if (BASH AND (NOT MSVC) AND (TARGET json2json)) # The scripts are not robust enough to run under Windows even if bash is available
|
||||
#
|
||||
# json2json test
|
||||
#
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
link_libraries(simdjson simdjson-internal-flags simdjson-windows-headers cxxopts)
|
||||
|
||||
add_executable(json2json json2json.cpp)
|
||||
add_executable(jsonstats jsonstats.cpp)
|
||||
add_executable(minify minify.cpp)
|
||||
if(TARGET cxxopts) # we only build the tools if cxxopts is available
|
||||
link_libraries(simdjson simdjson-internal-flags simdjson-windows-headers cxxopts)
|
||||
add_executable(json2json json2json.cpp)
|
||||
add_executable(jsonstats jsonstats.cpp)
|
||||
add_executable(minify minify.cpp)
|
||||
endif()
|
Loading…
Reference in New Issue