forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GDV-45: Make use of the modular features of cmake
Separate out the public and private target dependencies. For arrow, export an interface target. This avoids the need to add include dirs for each dependency on arrow. Removed dependency on gtest. Instead, build it as an external project. This is the recommended practice for googletest. For pre-compiled files, generate the bitcode files for each of them independently and then, link them to generate a unified bitcode file. Removed cpplint exceptions since there is no more sourcing of .cc files. Separate out the public include files from private includes, and add them in the dependency list in cmake. pass the bytecode filepath from cmake (instead of /tmp)
- Loading branch information
1 parent
b79d219
commit b3dee6a
Showing
37 changed files
with
290 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# Copyright (C) 2017-2018 Dremio Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
project(gandiva) | ||
|
||
# Find arrow | ||
find_package(ARROW) | ||
|
||
find_package(Boost REQUIRED) | ||
|
||
set(BC_FILE_PATH_CC "${CMAKE_CURRENT_BINARY_DIR}/bc_file_path.cc") | ||
configure_file(bc_file_path.cc.in ${BC_FILE_PATH_CC}) | ||
|
||
add_library(gandiva SHARED | ||
annotator.cc | ||
engine.cc | ||
evaluator.cc | ||
function_registry.cc | ||
llvm_generator.cc | ||
llvm_types.cc | ||
node.cc | ||
tree_expr_builder.cc | ||
${BC_FILE_PATH_CC}) | ||
|
||
# For users of gandiva library (including integ tests), include-dir is : | ||
# /usr/**/include dir after install, | ||
# cpp/include during build | ||
# For building gandiva library itself, include-dir (in addition to above) is : | ||
# cpp/src | ||
target_include_directories(gandiva | ||
PUBLIC | ||
$<INSTALL_INTERFACE:include> | ||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> | ||
PRIVATE | ||
${CMAKE_SOURCE_DIR}/src | ||
) | ||
|
||
# ARROW is a public dependency i.e users of gandiva also will have a dependency on arrow. | ||
target_link_libraries(gandiva | ||
PUBLIC | ||
ARROW::ARROW | ||
PRIVATE | ||
Boost::boost) | ||
|
||
# LLVM is a private dependency i.e users of gandiva will not need to include llvm headers | ||
# or link with llvm libraries. | ||
target_link_llvm(gandiva PRIVATE) | ||
|
||
# Set version for the library. | ||
set(GANDIVA_VERSION_MAJOR 0) | ||
set(GANDIVA_VERSION_MINOR 1) | ||
set(GANDIVA_VERSION_PATCH 0) | ||
set(GANDIVA_VERSION ${GANDIVA_VERSION_MAJOR}.${GANDIVA_VERSION_MINOR}.${GANDIVA_VERSION_PATCH}) | ||
|
||
set_target_properties(gandiva PROPERTIES | ||
VERSION ${GANDIVA_VERSION} | ||
SOVERSION ${GANDIVA_VERSION_MAJOR} | ||
) | ||
|
||
# install for gandiva | ||
include(GNUInstallDirs) | ||
|
||
# install libgandiva | ||
install( | ||
TARGETS gandiva | ||
DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) | ||
|
||
# install the header files. | ||
install( | ||
DIRECTORY ${CMAKE_SOURCE_DIR}/include/gandiva | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
) | ||
|
||
#args: label test-file src-files | ||
add_gandiva_unit_test(dex_llvm_test.cc) | ||
add_gandiva_unit_test(engine_llvm_test.cc engine.cc llvm_types.cc ${BC_FILE_PATH_CC}) | ||
add_gandiva_unit_test(function_signature_test.cc) | ||
add_gandiva_unit_test(function_registry_test.cc function_registry.cc) | ||
add_gandiva_unit_test(llvm_types_test.cc llvm_types.cc) | ||
add_gandiva_unit_test(llvm_generator_test.cc llvm_generator.cc engine.cc llvm_types.cc function_registry.cc annotator.cc ${BC_FILE_PATH_CC}) | ||
add_gandiva_unit_test(annotator_test.cc annotator.cc) | ||
add_gandiva_unit_test(tree_expr_test.cc tree_expr_builder.cc node.cc annotator.cc function_registry.cc) | ||
|
||
add_gandiva_integ_test(evaluator_test.cc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2017-2018 Dremio Corporation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
namespace gandiva { | ||
|
||
// Path to the byte-code file. | ||
extern const char kByteCodeFilePath[] = "${GANDIVA_BC_OUTPUT_PATH}"; | ||
|
||
} // namespace gandiva |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.