mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-23 20:01:06 +00:00
Support for CLANG compiler in CMakeLists.txt
This commit is contained in:
parent
40cc914567
commit
2ad45598eb
|
@ -3,12 +3,20 @@ project(POLARSSL C)
|
|||
|
||||
enable_testing()
|
||||
|
||||
string(REGEX MATCH "clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER}")
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -W -Wdeclaration-after-statement")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-g3 -O0")
|
||||
set(CMAKE_C_FLAGS_COVERAGE "-g3 -O0 -fprofile-arcs -ftest-coverage -lgcov")
|
||||
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
|
||||
if(CMAKE_COMPILER_IS_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -W -Wdeclaration-after-statement")
|
||||
set(CMAKE_C_FLAGS_DEBUG "-g3 -O0")
|
||||
set(CMAKE_C_FLAGS_CHECK "${CMAKE_C_FLAGS} -Wpointer-arith -Wwrite-strings -Wdocumentation -Werror")
|
||||
endif(CMAKE_COMPILER_IS_CLANG)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
|
||||
|
|
Loading…
Reference in a new issue