|
| 1 | +set(ENABLE_ANTLR4_CPP_RUNTIME_DEFAULT ${ENABLE_LIBRARIES}) |
| 2 | +option(ENABLE_ANTLR4_CPP_RUNTIME "Use ANTLR4 C++ runtime" ${ENABLE_ANTLR4_CPP_RUNTIME_DEFAULT}) |
| 3 | + |
| 4 | +if(NOT ENABLE_ANTLR4_CPP_RUNTIME) |
| 5 | + message(STATUS "Not using ANTLR4 C++ runtime") |
| 6 | + return() |
| 7 | +endif() |
| 8 | + |
| 9 | +set(_ANTLR4_CPP_RUNTIME_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/antlr4-cpp-runtime/runtime/Cpp") |
| 10 | + |
| 11 | +file(GLOB _ANTLR4_CPP_RUNTIME_SRC |
| 12 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/*.cpp" |
| 13 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/atn/*.cpp" |
| 14 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/dfa/*.cpp" |
| 15 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/internal/*.cpp" |
| 16 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/misc/*.cpp" |
| 17 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/support/*.cpp" |
| 18 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/tree/*.cpp" |
| 19 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/tree/pattern/*.cpp" |
| 20 | + "${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/tree/xpath/*.cpp" |
| 21 | +) |
| 22 | + |
| 23 | +set(_ANTLR4_CPP_RUNTIME_INCLUDE_DIRS |
| 24 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src |
| 25 | +) |
| 26 | + |
| 27 | +set(_ANTLR4_CPP_RUNTIME_PRIVATE_INCLUDE_DIRS |
| 28 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/atn |
| 29 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/dfa |
| 30 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/internal |
| 31 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/misc |
| 32 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/support |
| 33 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/tree |
| 34 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/tree/pattern |
| 35 | + ${_ANTLR4_CPP_RUNTIME_SOURCE_DIR}/runtime/src/tree/xpath |
| 36 | +) |
| 37 | + |
| 38 | +add_library(_ch_contrib_antlr4_cpp_runtime ${_ANTLR4_CPP_RUNTIME_SRC}) |
| 39 | + |
| 40 | +target_include_directories(_ch_contrib_antlr4_cpp_runtime |
| 41 | + PUBLIC "${_ANTLR4_CPP_RUNTIME_INCLUDE_DIRS}" |
| 42 | + PRIVATE "${_ANTLR4_CPP_RUNTIME_PRIVATE_INCLUDE_DIRS}" |
| 43 | +) |
| 44 | + |
| 45 | +add_library(ch_contrib::antlr4_cpp_runtime ALIAS _ch_contrib_antlr4_cpp_runtime) |
0 commit comments