@@ -35,39 +35,42 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
35
35
# Flags used by exes and by the simdjson library (project-wide flags)
36
36
#
37
37
add_library (simdjson-flags INTERFACE )
38
+ add_library (simdjson-internal -flags INTERFACE )
39
+ target_link_libraries (simdjson-internal -flags INTERFACE simdjson-flags )
40
+
38
41
if (MSVC )
39
- target_compile_options (simdjson-flags INTERFACE /nologo /D_CRT_SECURE_NO_WARNINGS)
40
- target_compile_options (simdjson-flags INTERFACE /WX /W3 /sdl)
42
+ target_compile_options (simdjson-internal - flags INTERFACE /nologo /D_CRT_SECURE_NO_WARNINGS)
43
+ target_compile_options (simdjson-internal - flags INTERFACE /WX /W3 /sdl)
41
44
else ()
42
- target_compile_options (simdjson-flags INTERFACE -fPIC)
45
+ target_compile_options (simdjson-internal - flags INTERFACE -fPIC)
43
46
if (NOT SIMDJSON_GOOGLE_BENCHMARKS) # Google Benchmark can't be compiled without warnings with -Weffc++
44
- target_compile_options (simdjson-flags INTERFACE -Weffc++)
47
+ target_compile_options (simdjson-internal - flags INTERFACE -Weffc++)
45
48
endif ()
46
- target_compile_options (simdjson-flags INTERFACE -Werror -Wall -Wextra -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
49
+ target_compile_options (simdjson-internal - flags INTERFACE -Werror -Wall -Wextra -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wno-sign-conversion)
47
50
endif ()
48
51
49
52
# Optional flags
50
53
option (SIMDJSON_IMPLEMENTATION_HASWELL "Include the haswell implementation" ON )
51
54
if (NOT SIMDJSON_IMPLEMENTATION_HASWELL)
52
- target_compile_definitions (simdjson-flags INTERFACE SIMDJSON_IMPLEMENTATION_HASWELL=0)
55
+ target_compile_definitions (simdjson-internal - flags INTERFACE SIMDJSON_IMPLEMENTATION_HASWELL=0)
53
56
endif ()
54
57
option (SIMDJSON_IMPLEMENTATION_WESTMERE "Include the westmere implementation" ON )
55
58
if (NOT SIMDJSON_IMPLEMENTATION_WESTMERE)
56
- target_compile_definitions (simdjson-flags INTERFACE SIMDJSON_IMPLEMENTATION_WESTMERE=0)
59
+ target_compile_definitions (simdjson-internal - flags INTERFACE SIMDJSON_IMPLEMENTATION_WESTMERE=0)
57
60
endif ()
58
61
option (SIMDJSON_IMPLEMENTATION_ARM64 "Include the arm64 implementation" ON )
59
62
if (NOT SIMDJSON_IMPLEMENTATION_ARM64)
60
- target_compile_definitions (simdjson-flags INTERFACE SIMDJSON_IMPLEMENTATION_ARM64=0)
63
+ target_compile_definitions (simdjson-internal - flags INTERFACE SIMDJSON_IMPLEMENTATION_ARM64=0)
61
64
endif ()
62
65
option (SIMDJSON_IMPLEMENTATION_FALLBACK "Include the fallback implementation" ON )
63
66
if (NOT SIMDJSON_IMPLEMENTATION_FALLBACK)
64
- target_compile_definitions (simdjson-flags INTERFACE SIMDJSON_IMPLEMENTATION_FALLBACK=0)
67
+ target_compile_definitions (simdjson-internal - flags INTERFACE SIMDJSON_IMPLEMENTATION_FALLBACK=0)
65
68
endif ()
66
69
67
70
option (SIMDJSON_EXCEPTIONS "Enable simdjson's exception-throwing interface" ON )
68
71
if (NOT SIMDJSON_EXCEPTIONS)
69
72
message (STATUS "simdjson exception interface turned off. Code that does not check error codes will not compile." )
70
- target_compile_definitions (simdjson-flags INTERFACE SIMDJSON_EXCEPTIONS=0)
73
+ target_compile_definitions (simdjson-internal - flags INTERFACE SIMDJSON_EXCEPTIONS=0)
71
74
endif ()
72
75
73
76
option (SIMDJSON_ENABLE_THREADS "Enable threaded operation" ON )
@@ -105,3 +108,4 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") # icc / icpc
105
108
endif ()
106
109
107
110
install (TARGETS simdjson-flags EXPORT simdjson-config)
111
+ install (TARGETS simdjson-internal -flags EXPORT simdjson-config)
0 commit comments