mirror of
https://github.com/apache/impala.git
synced 2025-12-19 18:12:08 -05:00
IMPALA-12263: Build with C++ Avro library when USE_AVRO_CPP is true
This change updates the AVRO CMake module to use the C++ Avro library when USE_AVRO_CPP is set to true. This is the next step towards Avro backend update. Building with the C++ library fails at this point. Testing: - Manually tested configuring the project with USE_AVRO_CPP Change-Id: I0a81c3f7ab5a6651d507d8d9fac77ea17b8bb1a1 Reviewed-on: http://gerrit.cloudera.org:8080/20156 Reviewed-by: Daniel Becker <daniel.becker@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
committed by
Impala Public Jenkins
parent
929b91ac64
commit
736b508e75
@@ -346,6 +346,7 @@ message(STATUS "RapidJson include dir: " ${RAPIDJSON_INCLUDE_DIR})
|
||||
# find Avro headers and libs
|
||||
find_package(Avro REQUIRED)
|
||||
IMPALA_ADD_THIRDPARTY_LIB(avro ${AVRO_INCLUDE_DIR} ${AVRO_STATIC_LIB} "")
|
||||
message(STATUS "Use C++ AVRO library: " $ENV{USE_AVRO_CPP})
|
||||
|
||||
# find ORC headers and libs
|
||||
find_package(Orc REQUIRED)
|
||||
|
||||
@@ -26,12 +26,24 @@ set(AVRO_SEARCH_HEADER_PATHS ${AVRO_ROOT}/include)
|
||||
|
||||
set(AVRO_SEARCH_LIB_PATH ${AVRO_ROOT}/lib)
|
||||
|
||||
find_path(AVRO_INCLUDE_DIR NAMES avro/schema.h schema.h PATHS
|
||||
${AVRO_SEARCH_HEADER_PATHS}
|
||||
set(AVRO_LIB_NAME "libavro.a")
|
||||
set(AVRO_PROBE_INCLUDE_NAME_1 "avro/schema.h")
|
||||
set(AVRO_PROBE_INCLUDE_NAME_2 "schema.h")
|
||||
|
||||
# Search for the AVRO C++ library when USE_AVRO_CPP environment variable is true.
|
||||
string(TOUPPER $ENV{USE_AVRO_CPP} USE_AVRO_CPP)
|
||||
if (USE_AVRO_CPP)
|
||||
set(AVRO_LIB_NAME "libavrocpp_s.a")
|
||||
set(AVRO_PROBE_INCLUDE_NAME_1 "avro/Schema.hh")
|
||||
set(AVRO_PROBE_INCLUDE_NAME_2 "Schema.hh")
|
||||
endif()
|
||||
|
||||
find_path(AVRO_INCLUDE_DIR NAMES ${AVRO_PROBE_INCLUDE_NAME_1} ${AVRO_PROBE_INCLUDE_NAME_2}
|
||||
PATHS ${AVRO_SEARCH_HEADER_PATHS}
|
||||
# make sure we don't accidentally pick up a different version
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
find_library(AVRO_STATIC_LIB NAMES libavro.a PATHS ${AVRO_SEARCH_LIB_PATH})
|
||||
find_library(AVRO_STATIC_LIB NAMES ${AVRO_LIB_NAME} PATHS ${AVRO_SEARCH_LIB_PATH})
|
||||
|
||||
if(NOT AVRO_STATIC_LIB)
|
||||
message(FATAL_ERROR "Avro includes and libraries NOT found. "
|
||||
|
||||
Reference in New Issue
Block a user