Fix MSVC compiler errors

This commit is contained in:
alejo committed 2026-10-07 18:11:55 -03:00
1 parent ba5971a788
commit 7ed885f0d1
2 files changed
+49

No files matched your search

+11
View File
@@ -73,6 +73,17 @@ else()
FetchContent_Declare(antlr4 ${_antlr_fetch_args})
FetchContent_MakeAvailable(antlr4)
# The runtime forgets some standard #includes (<chrono> for one), which newer
# standard libraries, notably Visual C++'s, no longer paper over. Supply them.
if(TARGET antlr4_static)
set(_compat "${CMAKE_CURRENT_SOURCE_DIR}/cmake/antlr_runtime_compat.h")
if(MSVC)
target_compile_options(antlr4_static PRIVATE "/FI${_compat}")
else()
target_compile_options(antlr4_static PRIVATE -include "${_compat}")
endif()
endif()
set(ANTLRLAB_RUNTIME_LIBS antlr4_static)
set(ANTLRLAB_RUNTIME_INCLUDES "${antlr4_SOURCE_DIR}/runtime/Cpp/runtime/src")
set(ANTLRLAB_RUNTIME_DEFS ANTLR4CPP_STATIC)