[CMAKE] Do not call clang with unsupported arguments

This commit is contained in:
Jérôme Gardou 2021-04-09 10:09:55 +02:00
parent f3e1697c2b
commit 83e1afe12a

View file

@ -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()