aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2015-07-19 16:00:04 +0200
committerManuel Pégourié-Gonnard <mpg2@elzevir.fr>2015-08-10 16:40:02 +0200
commit7f610533718876ea9d7d63d50c65b6aff4bb16b2 (patch)
tree6b9e8385e7700c0436321a075d7b524240e76cc7
parent027b79fd367a66d747a4aefbaef469a06398ada7 (diff)
downloadmbedtls-7f610533718876ea9d7d63d50c65b6aff4bb16b2.zip
mbedtls-7f610533718876ea9d7d63d50c65b6aff4bb16b2.tar.gz
mbedtls-7f610533718876ea9d7d63d50c65b6aff4bb16b2.tar.bz2
Fix bug with cmake and old version of GCC
-rw-r--r--CMakeLists.txt9
-rw-r--r--ChangeLog4
2 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebb29cd..f892848 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,14 @@ enable_testing()
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
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_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
diff --git a/ChangeLog b/ChangeLog
index 82824a0..d0a98b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,7 +9,9 @@ Security
2048 bits. This can be changed with ssl_set_dh_params().
Bugfix
- * Fix thread-safety issue in the SSL debug module.
+ * Fix thread-safety issue in SSL debug module (found by Edwin van Vliet).
+ * Fix build error with CMake and pre-4.5 versions of GCC (found by Hugo
+ Leisink).
Changes
* Add SSL_MIN_DHM_BYTES configuration parameter in config.h to choose the