Build with -fno-exceptions standalone. This serves two purposes: 1. Make sure we don't accidentally write "throw" or "catch" in our code. 2. If a C project statically links to our libssl.a, they'll use gcc rather than g++ as the linker which does not pull in the C++ runtime. -fno-exceptions cuts out the C++ runtime dependency. (Though we will need to give up on this should we attempt to allow a runtime dependency in the future.) Bug: 132 Change-Id: I9fc81f034833ec9ed38b98d98df7b45c32cfa30c Reviewed-on: https://boringssl-review.googlesource.com/18084 Reviewed-by: Steven Valdez <svaldez@google.com> Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
diff --git a/CMakeLists.txt b/CMakeLists.txt index cddffe2..3c2d556 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ set(C_CXX_FLAGS "${C_CXX_FLAGS} -Wno-free-nonheap-object") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_CXX_FLAGS} -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${C_CXX_FLAGS} -Wmissing-declarations") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${C_CXX_FLAGS} -Wmissing-declarations -fno-exceptions") # In GCC, -Wmissing-declarations is the C++ spelling of -Wmissing-prototypes # and using the wrong one is an error. In Clang, -Wmissing-prototypes is the # spelling for both and -Wmissing-declarations is some other warning.