Commit 80e98c86 authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

nlohmann_json: Restructure header wrapper to fix updating

parent 1d5cbd9e
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -64,13 +64,12 @@ else()
  add_subdirectory(pugixml)
endif()
adios2_add_thirdparty_target(pugixml pugixml)
if(ADIOS2_USE_EXTERNAL_NLOHMANN_JSON)
  find_package(nlohmann_json REQUIRED)
  adios2_add_thirdparty_target(nlohmann_json nlohmann_json::nlohmann_json)
else()

# ADIOS uses a wrapper header for nlohmann_json to suppress noisy compiler
# warnings
add_subdirectory(nlohmann_json)
  adios2_add_thirdparty_target(nlohmann_json nlohmann_json)
endif()
adios2_add_thirdparty_target(nlohmann_json nlohmann_json_wrapper)

if(ADIOS2_USE_EXTERNAL_YAMLCPP)
  find_package(yaml-cpp REQUIRED)
else()
+1 −1
Original line number Diff line number Diff line
message_start_thirdparty()

add_subdirectory(nlohmann_json)
add_subdirectory(nlohmann_json_wrapper)

message_end_thirdparty()
+0 −16
Original line number Diff line number Diff line
add_library(nlohmann_json INTERFACE)
target_sources(nlohmann_json INTERFACE
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/single_include/upstream/nlohmann/json.hpp>
)

target_sources(nlohmann_json INTERFACE
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/single_include/nlohmann_json.hpp>
)

target_compile_options(nlohmann_json INTERFACE $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Intel>>:-Wno-all -Wno-error>)

target_include_directories(nlohmann_json INTERFACE
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/single_include>
)
install(TARGETS nlohmann_json EXPORT adios2Exports)
+26 −0
Original line number Diff line number Diff line
add_library(nlohmann_json_wrapper INTERFACE)
target_sources(nlohmann_json_wrapper INTERFACE
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/nlohmann_json.hpp>
)
target_include_directories(nlohmann_json_wrapper INTERFACE
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
target_compile_options(nlohmann_json_wrapper INTERFACE
  $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:Intel>>:-Wno-all -Wno-error>
)

if(ADIOS2_USE_EXTERNAL_NLOHMANN_JSON)
  find_package(nlohmann_json REQUIRED)
  target_link_libraries(nlohmann_json_wrapper INTERFACE
    $<BUILD_INTERFACE:nlohmann_json::nlohmann_json>
  )
else()
  target_sources(nlohmann_json_wrapper INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/single_include/nlohmann/json.hpp>
  )
  target_include_directories(nlohmann_json_wrapper INTERFACE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/single_include>
  )
endif()

install(TARGETS nlohmann_json_wrapper EXPORT adios2Exports)
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ _Pragma("warning(disable:1011)")
#pragma clang diagnostic ignored "-Wall"
#endif

#include <upstream/nlohmann/json.hpp>
#include <nlohmann/json.hpp>

#if defined(_MSC_VER) && !defined(__clang__)
#pragma warning(pop)
Loading