Skip to content

Commit

Permalink
Cleaned merge.
Browse files Browse the repository at this point in the history
  • Loading branch information
EpsilonPrime committed Feb 8, 2024
2 parents a72a827 + d0c187d commit 320053c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_compile_options($<$<CONFIG:Debug>:-fsanitize=undefined>)
add_link_options($<$<CONFIG:Debug>:-fsanitize=undefined>)
option(SUBSTRAIT_CPP_SANITIZE_DEBUG_BUILD
"Turns on address and undefined memory sanitization runtime checking."
ON)

add_compile_options($<$<CONFIG:Debug>:-fsanitize=address>)
add_link_options($<$<CONFIG:Debug>:-fsanitize=address>)
if(${SUBSTRAIT_CPP_SANITIZE_DEBUG_BUILD})
add_compile_options($<$<CONFIG:Debug>:-fsanitize=undefined>)
add_link_options($<$<CONFIG:Debug>:-fsanitize=undefined>)

add_compile_options($<$<CONFIG:Debug>:-fsanitize=address>)
add_link_options($<$<CONFIG:Debug>:-fsanitize=address>)
endif()

option(
SUBSTRAIT_CPP_BUILD_TESTING
Expand Down
15 changes: 6 additions & 9 deletions src/substrait/proto/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

find_package(Protobuf REQUIRED)
include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -8,8 +7,10 @@ find_package(Perl REQUIRED)
set(UPDATE_PROTO_PACKAGE_TOOL
"${CMAKE_CURRENT_SOURCE_DIR}/update_proto_package.pl")

set(PROTO_INCLUDE_DIR
"${CMAKE_SOURCE_DIR}/third_party/substrait/proto/substrait")
set(RAW_PROTO_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party/substrait/proto/substrait"
)
cmake_path(SET PROTO_INCLUDE_DIR NORMALIZE "${RAW_PROTO_INCLUDE_DIR}")
cmake_path(GET PROTO_INCLUDE_DIR PARENT_PATH PROTO_INCLUDE_TOPLEVEL_DIR)
set(PROTOBUF_IMPORT_DIRS ${PROTO_INCLUDE_DIR}/extensions)

Expand All @@ -24,9 +25,7 @@ set(GENERATED_PROTO_MIDLEVEL_DIR
"${GENERATED_PROTO_TOPLEVEL_DIR}/substrait/proto")
set(GENERATED_PROTOBUF_LIST)
foreach(PROTO_FILE IN LISTS PROTOBUF_FILELIST)
file(RELATIVE_PATH RELATIVE_PROTO_PATH
"${CMAKE_SOURCE_DIR}/third_party/substrait/proto/substrait"
"${PROTO_FILE}")
file(RELATIVE_PATH RELATIVE_PROTO_PATH "${PROTO_INCLUDE_DIR}" "${PROTO_FILE}")
set(GENERATED_PROTO_FILE
${GENERATED_PROTO_MIDLEVEL_DIR}/${RELATIVE_PROTO_PATH})

Expand Down Expand Up @@ -54,9 +53,7 @@ cmake_path(GET PROTO_OUTPUT_PARENT_DIR PARENT_PATH PROTO_OUTPUT_MIDLEVEL_DIR)
cmake_path(GET PROTO_OUTPUT_MIDLEVEL_DIR PARENT_PATH PROTO_OUTPUT_TOPLEVEL_DIR)

foreach(PROTO_FILE IN LISTS PROTOBUF_FILELIST)
file(RELATIVE_PATH RELATIVE_PROTO_PATH
"${CMAKE_SOURCE_DIR}/third_party/substrait/proto/substrait"
"${PROTO_FILE}")
file(RELATIVE_PATH RELATIVE_PROTO_PATH "${PROTO_INCLUDE_DIR}" "${PROTO_FILE}")
set(GENERATED_PROTO_FILE
${GENERATED_PROTO_MIDLEVEL_DIR}/${RELATIVE_PROTO_PATH})
message(
Expand Down
5 changes: 3 additions & 2 deletions src/substrait/textplan/parser/grammar/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# SPDX-License-Identifier: Apache-2.0

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/third_party/antlr4/cmake")
list(APPEND CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../../third_party/antlr4/cmake")

set(CMAKE_CXX_STANDARD 17)

add_definitions(-DANTLR4CPP_STATIC)

set(GRAMMAR_DIR ${CMAKE_BINARY_DIR}/src/substrait/textplan/parser/grammar)
set(GRAMMAR_DIR ${CMAKE_CURRENT_BINARY_DIR})

# using /MD flag for antlr4_runtime (for Visual C++ compilers only)
set(ANTLR4_WITH_STATIC_CRT OFF)
Expand Down
3 changes: 1 addition & 2 deletions src/substrait/textplan/parser/tests/TextPlanParserTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1061,8 +1061,7 @@ std::vector<TestCase> getTestCases() {
"1:0 → extraneous input 'relation' expecting {<EOF>, "
"'EXTENSION_SPACE', 'NAMED', 'SCHEMA', 'PIPELINES', 'FILTER', "
"'GROUPING', 'MEASURE', 'SORT', 'COUNT', 'TYPE', 'EMIT', "
"'OR', 'ALL', COMPARISON, "
"'SOURCE', 'ROOT', 'NULL', IDENTIFIER}",
"'ALL', COMPARISON, 'SOURCE', 'ROOT', 'NULL', IDENTIFIER}",
"1:24 → mismatched input '{' expecting 'RELATION'",
"1:9 → Unrecognized relation type: notyperelation",
"1:9 → Internal error: Previously encountered symbol "
Expand Down

0 comments on commit 320053c

Please sign in to comment.