Skip to content

Commit 73d7d70

Browse files
committed
CMake: Remove export_private_library
Since we are exporting all the targets as part of the main simdjson target we do not need private exports anymore
1 parent 44b06d7 commit 73d7d70

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

include/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ add_library(simdjson-headers INTERFACE)
88
target_compile_features(simdjson-headers INTERFACE cxx_std_11) # headers require at least C++11
99
target_include_directories(simdjson-headers INTERFACE
1010
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
11-
$<INSTALL_INTERFACE:include/>)
11+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCDIR}>)
1212

13-
install(TARGETS simdjson-headers
14-
EXPORT simdjson-config
15-
INCLUDES DESTINATION include)
13+
install(TARGETS simdjson-headers EXPORT simdjson-config INCLUDES DESTINATION include)
1614
install(DIRECTORY simdjson DESTINATION include FILES_MATCHING PATTERN *.h)
1715
install(DIRECTORY simdjson DESTINATION include FILES_MATCHING PATTERN *.hpp)
1816
install(FILES simdjson.h DESTINATION include)

simdjson-flags.cmake

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ endif()
8080

8181
option(SIMDJSON_SANITIZE "Sanitize addresses" OFF)
8282
if(SIMDJSON_SANITIZE)
83-
# Not sure which
8483
target_compile_options(simdjson-flags INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all)
8584
target_link_libraries(simdjson-flags INTERFACE -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=all)
8685

@@ -105,14 +104,4 @@ if(${CMAKE_C_COMPILER_ID} MATCHES "Intel") # icc / icpc
105104
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
106105
endif()
107106

108-
# Workaround for https://gitlab.kitware.com/cmake/cmake/issues/15415#note_633938:
109-
function(export_private_library NAME)
110-
install(TARGETS ${NAME}
111-
EXPORT simdjson-config
112-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
113-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
114-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
115-
)
116-
endfunction()
117-
118-
export_private_library(simdjson-flags)
107+
install(TARGETS simdjson-flags EXPORT simdjson-config)

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
add_library(simdjson-include-source INTERFACE)
99
target_link_libraries(simdjson-include-source INTERFACE simdjson-headers)
1010
target_include_directories(simdjson-include-source INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
11-
export_private_library(simdjson-include-source)
11+
install(TARGETS simdjson-include-source EXPORT simdjson-config)
1212

1313
#
1414
# For callers who intend to compile simdjson.cpp themselves.
@@ -19,7 +19,7 @@ export_private_library(simdjson-include-source)
1919
add_library(simdjson-source INTERFACE)
2020
target_sources(simdjson-source INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/simdjson.cpp)
2121
target_link_libraries(simdjson-source INTERFACE simdjson-include-source)
22-
export_private_library(simdjson-source)
22+
install(TARGETS simdjson-source EXPORT simdjson-config)
2323

2424
#
2525
# simdjson is the distributed library compiled with flags.

0 commit comments

Comments
 (0)