File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ if(WITH_DEMO)
75
75
endif ()
76
76
endif (WITH_DEMO)
77
77
78
- if (MSVC_VERSION )
78
+ if (" ${CMAKE_CXX_COMPILER_ID} " MATCHES "MSVC" )
79
79
set (MY_CXX_WARNING_FLAGS " /W4" )
80
80
else ()
81
81
set (MY_CXX_WARNING_FLAGS " -Wall -pedantic -W" )
@@ -102,7 +102,8 @@ else()
102
102
endif ()
103
103
104
104
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_WARNING_FLAGS} " )
105
- if (MSVC_VERSION )
105
+
106
+ if ("${CMAKE_CXX_COMPILER_ID} " MATCHES "MSVC" )
106
107
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MP ${MY_CXX_WARNING_FLAGS} " )
107
108
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /O1 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLAGS} " )
108
109
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Oi /Ob2 /Gy /MP /DNDEBUG ${MY_CXX_WARNING_FLGAS} " )
Original file line number Diff line number Diff line change @@ -87,12 +87,14 @@ set(extra_share_compile_flags "")
87
87
set (extra_static_compile_flags "" )
88
88
set (static_lib_suffix "" )
89
89
90
- if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
90
+ if ( WIN32 )
91
91
set (static_lib_suffix "-static" )
92
92
target_compile_definitions (antlr4_shared PUBLIC ANTLR4CPP_EXPORTS)
93
93
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 ()
96
98
endif ()
97
99
98
100
set_target_properties (antlr4_shared
You can’t perform that action at this time.
0 commit comments