You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/08 13:28:55 UTC

[GitHub] [arrow] kou commented on a change in pull request #11963: ARROW-15066: [C++] Enable use of non-bundled OpenTelemetry

kou commented on a change in pull request #11963:
URL: https://github.com/apache/arrow/pull/11963#discussion_r821661028



##########
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:
       Why do we need this?
   




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org