From c973768495fad4b6f38064cb9f4d89a985efd41e Mon Sep 17 00:00:00 2001 From: altf_four <56314286+realaltffour@users.noreply.github.com> Date: Mon, 27 Apr 2020 00:11:51 +0300 Subject: [PATCH] CMake: Fix incorrect compiler flags (#139) * Fix CMake compiler args. - Replace -stdlib=libc++ with -std=gnu11 & apply it to clang too. - Remove redundant -fstrict-aliasing. - Remove warned and redundant -Weverything --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b90e59..34cf080 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,11 +24,12 @@ if(MSVC) add_definitions(-DNDEBUG -D_WINDOWS -D_USRDLL -DCGLM_EXPORTS -DCGLM_DLL) add_compile_options("/W3" "/Ox" "/Gy" "/Oi" "/TC" "/analyze") else() - add_compile_options("-Wall" "-Werror" "-O3") + add_compile_options("-Wall" "-Werror" "-std=gnu11" "-O3") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - add_compile_options("-stdlib=libc++" "-Weverything") + # Currently, nothing special to be seen here. else() - add_compile_options("-Werror=strict-prototypes" "-fstrict-aliasing") + add_compile_options("-Werror=strict-prototypes") + endif() endif()