Skip to content

Commit 802b3a4

Browse files
committed
Build using clang (not clang-cl)
Signed-off-by: HS <hs@apotell.com>
1 parent 7de734d commit 802b3a4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

runtime/Cpp/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if(WITH_DEMO)
7575
endif()
7676
endif(WITH_DEMO)
7777

78-
if(MSVC_VERSION)
78+
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
7979
set(MY_CXX_WARNING_FLAGS " /W4")
8080
else()
8181
set(MY_CXX_WARNING_FLAGS " -Wall -pedantic -W")
@@ -102,7 +102,8 @@ else()
102102
endif()
103103

104104
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS}")
105-
if(MSVC_VERSION)
105+
106+
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
106107
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MP ${MY_CXX_WARNING_FLAGS}")
107108
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /O1 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLAGS}")
108109
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLGAS}")

runtime/Cpp/runtime/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,14 @@ set(extra_share_compile_flags "")
8787
set(extra_static_compile_flags "")
8888
set(static_lib_suffix "")
8989

90-
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
90+
if (WIN32)
9191
set(static_lib_suffix "-static")
9292
target_compile_definitions(antlr4_shared PUBLIC ANTLR4CPP_EXPORTS)
9393
target_compile_definitions(antlr4_static PUBLIC ANTLR4CPP_STATIC)
94-
set(extra_share_compile_flags "-MP /wd4251")
95-
set(extra_static_compile_flags "-MP")
94+
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
95+
set(extra_share_compile_flags "-MP /wd4251")
96+
set(extra_static_compile_flags "-MP")
97+
endif()
9698
endif()
9799

98100
set_target_properties(antlr4_shared

0 commit comments

Comments
 (0)