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
This commit is contained in:
altf_four
2020-04-27 00:11:51 +03:00
committed by GitHub
parent 6d8e2cc92d
commit c973768495

View File

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