From 316a2d600e8c3e79681731014e8edf0ea2092d84 Mon Sep 17 00:00:00 2001 From: Henrik Holm Date: Thu, 1 Apr 2021 15:12:32 +0200 Subject: [PATCH] Only add compiler arguments for GCC and CLang --- runtime/CMakeLists.txt | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index c960a19..46a2cc6 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -314,16 +314,17 @@ add_library(${ANTLR4_CPP_RUNTIME} ${ANTLR4_CPP_RUNTIME_SRC}) target_include_directories(${ANTLR4_CPP_RUNTIME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src ) - -if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") - target_compile_options(${ANTLR4_CPP_RUNTIME} PRIVATE - -g -Wall -O0 - ) -else() - target_compile_options(${ANTLR4_CPP_RUNTIME} PRIVATE - -w -O3 - ) - target_compile_options(${ANTLR4_CPP_RUNTIME} PUBLIC - -Wno-attributes - ) -endif() +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") + target_compile_options(${ANTLR4_CPP_RUNTIME} PRIVATE + -g -Wall -O0 + ) + else() + target_compile_options(${ANTLR4_CPP_RUNTIME} PRIVATE + -w -O3 + ) + target_compile_options(${ANTLR4_CPP_RUNTIME} PUBLIC + -Wno-attributes + ) + endif() +endif() \ No newline at end of file