File tree Expand file tree Collapse file tree 9 files changed +667
-657
lines changed Expand file tree Collapse file tree 9 files changed +667
-657
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,9 @@ if (Git_FOUND)
58
58
# - second, cmake ..
59
59
add_custom_command (
60
60
OUTPUT ${SIMDJSON_CHECKPERF_DIR} /build/cmake_install.cmake # We make many things but this seems the most cross-platform one we can depend on
61
- COMMAND ${CMAKE_COMMAND} -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DSIMDJSON_COMPETITION=OFF -G ${CMAKE_GENERATOR} ..
61
+ COMMAND
62
+ ${CMAKE_COMMAND} -E env CXX=${CMAKE_CXX_COMPILER} CC=${CMAKE_C_COMPILER}
63
+ ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DSIMDJSON_GOOGLE_BENCHMARKS=OFF -DSIMDJSON_COMPETITION=OFF -G ${CMAKE_GENERATOR} ..
62
64
WORKING_DIRECTORY ${SIMDJSON_CHECKPERF_DIR} /build
63
65
DEPENDS ${SIMDJSON_CHECKPERF_DIR} /build/CMakeCache.txt
64
66
)
Original file line number Diff line number Diff line change @@ -11,6 +11,3 @@ target_include_directories(simdjson-headers INTERFACE
11
11
$< INSTALL_INTERFACE:${CMAKE_INSTALL_INCDIR} > )
12
12
13
13
install (TARGETS simdjson-headers EXPORT simdjson-config INCLUDES DESTINATION include )
14
- install (DIRECTORY simdjson DESTINATION include FILES_MATCHING PATTERN *.h )
15
- install (DIRECTORY simdjson DESTINATION include FILES_MATCHING PATTERN *.hpp )
16
- install (FILES simdjson.h DESTINATION include )
Original file line number Diff line number Diff line change @@ -72,7 +72,6 @@ else(MSVC)
72
72
# "make amalgamate" to generate the header files directly and update the original source
73
73
#
74
74
add_custom_target (amalgamate DEPENDS ${CMAKE_CURRENT_SOURCE_DIR} /simdjson.cpp ${CMAKE_CURRENT_SOURCE_DIR} /simdjson.h ${CMAKE_CURRENT_SOURCE_DIR} /amalgamate_demo.cpp ${CMAKE_CURRENT_SOURCE_DIR} /README.md )
75
-
76
75
endif (MSVC )
77
76
78
77
@@ -96,3 +95,5 @@ add_dependencies(simdjson-singleheader-source amalgamate)
96
95
add_executable (amalgamate_demo $< BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /amalgamate_demo.cpp> )
97
96
target_link_libraries (amalgamate_demo simdjson-singleheader-include-source simdjson-internal-flags simdjson-flags )
98
97
add_test (amalgamate_demo amalgamate_demo ${EXAMPLE_JSON} ${EXAMPLE_NDJSON} )
98
+
99
+ install (FILES simdjson.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
Original file line number Diff line number Diff line change 6
6
set -e
7
7
8
8
SCRIPTPATH=" $( cd " $( dirname " $0 " ) " ; pwd -P ) "
9
-
9
+ PROJECTPATH= $( realpath " $SCRIPTPATH /.. " ) ;
10
10
echo " We are about to amalgamate all simdjson files into one source file. "
11
11
echo " See https://www.sqlite.org/amalgamation.html and https://en.wikipedia.org/wiki/Single_Compilation_Unit for rationale. "
12
12
13
- if [ -z " $AMALGAMATE_SOURCE_PATH " ]; then AMALGAMATE_SOURCE_PATH=" $SCRIPTPATH /../src" ; fi
14
- if [ -z " $AMALGAMATE_INCLUDE_PATH " ]; then AMALGAMATE_INCLUDE_PATH=" $SCRIPTPATH /../include" ; fi
13
+ if [ -z " $AMALGAMATE_SOURCE_PATH " ]; then AMALGAMATE_SOURCE_PATH=$( realpath " $SCRIPTPATH /../src" ) ; fi
14
+ if [ -z " $AMALGAMATE_INCLUDE_PATH " ]; then AMALGAMATE_INCLUDE_PATH=$( realpath " $SCRIPTPATH /../include" ) ; fi
15
15
if [ -z " $AMALGAMATE_OUTPUT_PATH " ]; then AMALGAMATE_OUTPUT_PATH=" $SCRIPTPATH " ; fi
16
16
17
17
# this list excludes the "src/generic headers"
@@ -66,8 +66,9 @@ function doinclude()
66
66
function dofile()
67
67
{
68
68
file=" $1 /$2 "
69
+ RELFILE=${file# " $PROJECTPATH /" }
69
70
# Last lines are always ignored. Files should end by an empty lines.
70
- echo " /* begin file ${2} */"
71
+ echo " /* begin file $RELFILE */"
71
72
# echo "#line 8 \"$1\"" ## redefining the line/file is not nearly as useful as it sounds for debugging. It breaks IDEs.
72
73
while IFS= read -r line || [ -n " $line " ];
73
74
do
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ include(${PROJECT_SOURCE_DIR}/tests/add_cpp_test.cmake)
42
42
#
43
43
# These tests explicitly do #include "simdjson.cpp" so they can override stuff
44
44
#
45
- if ( NOT MSVC ) # Can't get simdjson-source to compile on Windows for some reason.
46
- add_cpp_test (numberparsingcheck LABELS acceptance per_implementation )
47
- target_link_libraries (numberparsingcheck simdjson-include-source )
48
- add_cpp_test (stringparsingcheck LABELS acceptance per_implementation )
49
- target_link_libraries (stringparsingcheck simdjson-include-source )
50
- endif ( )
45
+ add_cpp_test ( numberparsingcheck LABELS acceptance per_implementation )
46
+ target_link_libraries (numberparsingcheck simdjson-include-source simdjson-windows-headers )
47
+ target_compile_definitions (numberparsingcheck PRIVATE NOMINMAX )
48
+ add_cpp_test (stringparsingcheck LABELS acceptance per_implementation )
49
+ target_link_libraries (stringparsingcheck simdjson-include-source simdjson-windows-headers )
50
+ target_compile_definitions ( stringparsingcheck PRIVATE NOMINMAX )
51
51
52
52
# All remaining tests link with simdjson proper
53
53
link_libraries (simdjson )
Original file line number Diff line number Diff line change 1
1
#include < cstring>
2
- #include < dirent.h>
3
2
#include < inttypes.h>
4
3
#include < math.h>
5
4
#include < stdbool.h>
10
9
#define JSON_TEST_NUMBERS
11
10
#endif
12
11
12
+ #ifndef _MSC_VER
13
+ #include < dirent.h>
14
+ #else
15
+ #include < dirent_portable.h>
16
+ #endif
13
17
#include " simdjson.h"
14
18
15
19
// ulp distance
Original file line number Diff line number Diff line change 1
1
#include < cassert>
2
2
#include < climits>
3
3
#include < cstring>
4
- #include < dirent.h>
5
4
#include < inttypes.h>
6
5
#include < iostream>
7
6
#include < math.h>
13
12
#define JSON_TEST_STRINGS
14
13
#endif
15
14
15
+ #ifndef _MSC_VER
16
+ #include < dirent.h>
17
+ #else
18
+ #include < dirent_portable.h>
19
+ #endif
16
20
#include " simdjson.h"
17
21
18
22
char *fullpath;
Original file line number Diff line number Diff line change 1
1
add_library (simdjson-windows-headers INTERFACE )
2
2
if (MSVC )
3
3
target_include_directories (simdjson-windows-headers INTERFACE . )
4
- endif ()
4
+ endif ()
You can’t perform that action at this time.
0 commit comments