Fix bug with cmake and old version of GCC

This commit is contained in:
Manuel Pégourié-Gonnard 2015-07-19 16:00:04 +02:00 committed by Manuel Pégourié-Gonnard
parent 501084c764
commit a64b15ee73
2 changed files with 10 additions and 2 deletions

View file

@ -4,7 +4,14 @@ project(MBEDTLS C)
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings -Wlogical-op") # some warnings we want are not available with old GCC versions
# note: starting with CMake 2.8 we could use CMAKE_C_COMPILER_VERSION
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -W -Wdeclaration-after-statement -Wwrite-strings")
if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.5)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wlogical-op")
endif()
set(CMAKE_C_FLAGS_RELEASE "-O2") set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3") set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage") set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")

View file

@ -8,11 +8,12 @@ Security
* Increase the size of default Diffie-Hellman parameters on the server to * Increase the size of default Diffie-Hellman parameters on the server to
2048 bits. This can be changed with ssl_set_dh_params(). 2048 bits. This can be changed with ssl_set_dh_params().
Bugfix Bugfix
* Fix thread-safety issue in SSL debug module (found by Edwin van Vliet). * Fix thread-safety issue in SSL debug module (found by Edwin van Vliet).
* Some example programs were not built using make, not included in Visual * Some example programs were not built using make, not included in Visual
Studio projects (found by Kristian Bendiksen). Studio projects (found by Kristian Bendiksen).
* Fix build error with CMake and pre-4.5 versions of GCC (found by Hugo
Leisink).
Changes Changes
* Add SSL_MIN_DHM_BYTES configuration parameter in config.h to choose the * Add SSL_MIN_DHM_BYTES configuration parameter in config.h to choose the