You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

cmake_minimum_required(VERSION 3.15)
project(antlr4_runtime_vendor LANGUAGES CXX)
# 仅构建静态库运行时生成器antlr jar不在 CMake 内集成(按仓库约定不提供脚本)。
add_library(antlr4_runtime STATIC)
target_compile_features(antlr4_runtime PUBLIC cxx_std_17)
target_include_directories(antlr4_runtime PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/atn"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/dfa"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/internal"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/misc"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/support"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/tree"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/tree/pattern"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/tree/xpath"
)
file(GLOB_RECURSE ANTLR4_RUNTIME_SOURCES CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/atn/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/dfa/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/internal/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/misc/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/support/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/tree/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/tree/pattern/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/runtime/src/tree/xpath/*.cpp"
)
target_sources(antlr4_runtime PRIVATE ${ANTLR4_RUNTIME_SOURCES})
# Linux/Unix 下需要 pthread 以保证 std::call_once 等线程相关行为正确
find_package(Threads REQUIRED)
target_link_libraries(antlr4_runtime PUBLIC Threads::Threads)