-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
solve compiling issues and add a unit test
- Loading branch information
Showing
21 changed files
with
1,822 additions
and
89 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,60 @@ | ||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# 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. | ||
|
||
# Set up Proto | ||
set(proto_directory ${CMAKE_CURRENT_SOURCE_DIR}/proto) | ||
set(substrait_proto_directory ${CMAKE_CURRENT_SOURCE_DIR}/proto/substrait) | ||
set(PROTO_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/proto/") | ||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/proto/substrait) | ||
file(GLOB PROTO_FILES ${substrait_proto_directory}/*.proto | ||
${substrait_proto_directory}/extensions/*.proto) | ||
FOREACH(PROTO ${PROTO_FILES}) | ||
file(RELATIVE_PATH REL_PROTO ${substrait_proto_directory} ${PROTO}) | ||
string(REGEX REPLACE "\\.proto" "" PROTO_NAME ${REL_PROTO}) | ||
LIST(APPEND PROTO_SRCS "${PROTO_OUTPUT_DIR}/substrait/${PROTO_NAME}.pb.cc") | ||
LIST(APPEND PROTO_HDRS "${PROTO_OUTPUT_DIR}/substrait/${PROTO_NAME}.pb.h") | ||
ENDFOREACH() | ||
set(PROTO_OUTPUT_FILES ${PROTO_HDRS} ${PROTO_SRCS}) | ||
set_source_files_properties(${PROTO_OUTPUT_FILES} PROPERTIES GENERATED TRUE) | ||
|
||
get_filename_component(PROTO_DIR ${substrait_proto_directory}/, | ||
DIRECTORY) | ||
|
||
# Generate Substrait hearders | ||
add_custom_command(OUTPUT ${PROTO_OUTPUT_FILES} | ||
COMMAND protoc | ||
--proto_path | ||
${proto_directory}/ | ||
--cpp_out | ||
${PROTO_OUTPUT_DIR} | ||
${PROTO_FILES} | ||
DEPENDS ${PROTO_DIR} | ||
COMMENT "Running PROTO compiler" | ||
VERBATIM) | ||
add_custom_target(substrait_proto ALL DEPENDS ${PROTO_OUTPUT_FILES}) | ||
add_dependencies(substrait_proto protobuf::libprotobuf) | ||
|
||
add_library(velox_substrait_utils SubstraitUtils.cpp) | ||
target_include_directories(velox_substrait_utils PUBLIC ${PROTO_OUTPUT_DIR}) | ||
|
||
add_library(velox_substrait_expr_converter SubstraitToVeloxExpr.cpp) | ||
target_link_libraries(velox_substrait_expr_converter velox_substrait_utils velox_connector velox_dwio_dwrf_common) | ||
|
||
add_library(velox_substrait_plan_converter SubstraitToVeloxPlan.cpp) | ||
target_link_libraries(velox_substrait_plan_converter velox_substrait_expr_converter) | ||
|
||
# Disable tests temporarily for some linking issues are not resolved. | ||
#if(${VELOX_BUILD_TESTING}) | ||
# add_subdirectory(tests) | ||
#endif() |
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.