lidavidm commented on a change in pull request #11963:
URL: https://github.com/apache/arrow/pull/11963#discussion_r823878248
##########
File path: cpp/cmake_modules/ThirdpartyToolchain.cmake
##########
@@ -3749,36 +3754,42 @@ macro(build_crc32c_once)
endif()
endmacro()
-macro(build_nlohmann_json_once)
- if(NOT TARGET nlohmann_json_ep)
- message(STATUS "Building nlohmann-json from source")
- # "Build" nlohmann-json
- set(NLOHMANN_JSON_PREFIX
"${CMAKE_CURRENT_BINARY_DIR}/nlohmann_json_ep-install")
- set(NLOHMANN_JSON_INCLUDE_DIR "${NLOHMANN_JSON_PREFIX}/include")
- set(NLOHMANN_JSON_CMAKE_ARGS
- ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
- -DBUILD_TESTING=OFF -DJSON_BuildTests=OFF)
+macro(build_nlohmann_json)
+ message(STATUS "Building nlohmann-json from source")
+ # "Build" nlohmann-json
+ set(NLOHMANN_JSON_PREFIX
"${CMAKE_CURRENT_BINARY_DIR}/nlohmann_json_ep-install")
+ set(NLOHMANN_JSON_INCLUDE_DIR "${NLOHMANN_JSON_PREFIX}/include")
+ set(NLOHMANN_JSON_CMAKE_ARGS
+ ${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
-DBUILD_TESTING=OFF
+ -DJSON_BuildTests=OFF)
- set(NLOHMANN_JSON_BUILD_BYPRODUCTS
${NLOHMANN_JSON_PREFIX}/include/nlohmann/json.hpp)
+ set(NLOHMANN_JSON_BUILD_BYPRODUCTS
${NLOHMANN_JSON_PREFIX}/include/nlohmann/json.hpp)
- externalproject_add(nlohmann_json_ep
- ${EP_LOG_OPTIONS}
- INSTALL_DIR ${NLOHMANN_JSON_PREFIX}
- URL ${NLOHMANN_JSON_SOURCE_URL}
- URL_HASH
"SHA256=${ARROW_NLOHMANN_JSON_BUILD_SHA256_CHECKSUM}"
- CMAKE_ARGS ${NLOHMANN_JSON_CMAKE_ARGS}
- BUILD_BYPRODUCTS ${NLOHMANN_JSON_BUILD_BYPRODUCTS})
+ externalproject_add(nlohmann_json_ep
+ ${EP_LOG_OPTIONS}
+ INSTALL_DIR ${NLOHMANN_JSON_PREFIX}
+ URL ${NLOHMANN_JSON_SOURCE_URL}
+ URL_HASH
"SHA256=${ARROW_NLOHMANN_JSON_BUILD_SHA256_CHECKSUM}"
+ CMAKE_ARGS ${NLOHMANN_JSON_CMAKE_ARGS}
+ BUILD_BYPRODUCTS ${NLOHMANN_JSON_BUILD_BYPRODUCTS})
- # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052
- file(MAKE_DIRECTORY ${NLOHMANN_JSON_INCLUDE_DIR})
+ # Work around https://gitlab.kitware.com/cmake/cmake/issues/15052
+ file(MAKE_DIRECTORY ${NLOHMANN_JSON_INCLUDE_DIR})
- add_library(nlohmann_json::nlohmann_json INTERFACE IMPORTED)
- set_target_properties(nlohmann_json::nlohmann_json
- PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
- "${NLOHMANN_JSON_INCLUDE_DIR}")
- add_dependencies(nlohmann_json::nlohmann_json nlohmann_json_ep)
- endif()
+ add_library(nlohmann_json::nlohmann_json INTERFACE IMPORTED)
+ set_target_properties(nlohmann_json::nlohmann_json
+ PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
+ "${NLOHMANN_JSON_INCLUDE_DIR}")
+ add_dependencies(nlohmann_json::nlohmann_json nlohmann_json_ep)
endmacro()
+if(ARROW_WITH_NLOHMANN_JSON)
+ set(nlohmann_json_SOURCE "AUTO")
Review comment:
Thanks for the explanation, I've updated the Fedora/MSYS/Debian/Ubuntu
dockerfiles.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]