From 83e1afe12a8c8ecf1bda602c31c29e341b5d3553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Fri, 9 Apr 2021 10:09:55 +0200 Subject: [PATCH] [CMAKE] Do not call clang with unsupported arguments --- sdk/cmake/gcc.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 9da30e09008..b1d4b95fb14 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -123,7 +123,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release") add_compile_options(-O2 -DNDEBUG) else() if(OPTIMIZE STREQUAL "1") - add_compile_options(-Os -ftracer) + add_compile_options(-Os) + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + add_compile_options(-ftracer) + endif() elseif(OPTIMIZE STREQUAL "2") add_compile_options(-Os) elseif(OPTIMIZE STREQUAL "3") @@ -154,7 +157,9 @@ if(ARCH STREQUAL "i386") add_compile_options(-momit-leaf-frame-pointer) endif() elseif(ARCH STREQUAL "amd64") - add_compile_options(-mpreferred-stack-boundary=4) + if (CMAKE_C_COMPILER_ID STREQUAL "GNU") + add_compile_options(-mpreferred-stack-boundary=4) + endif() add_compile_options(-Wno-error) endif()