Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Unified Diff: build/config/compiler/BUILD.gn

Issue 431803003: gn win: Enable exceptions for pdfium build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: include pdfium roll Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 09f8e6270904dfcf32a5ca15d05c00a8e1ae916c..17e6cb61cdec3bb746bf44a550d525877acbc99d 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -54,12 +54,6 @@ config("compiler") {
"/GS", # Enable buffer security checking.
"/FS", # Preserve previous PDB behavior.
]
- if (is_component_build) {
- cflags += [
- "/EHsc", # Assume C functions can't throw exceptions and don't catch
- # structured exceptions (only C++ ones).
- ]
- }
} else {
# Common GCC compiler flags setup.
# --------------------------------
@@ -353,9 +347,6 @@ config("runtime_library") {
} else {
# Static CRT.
if (is_win) {
- # We don't use exceptions, and when we link statically we can just get
- # rid of them entirely.
- defines += [ "_HAS_EXCEPTIONS=0" ]
if (is_debug) {
cflags += [ "/MTd" ]
} else {
@@ -563,6 +554,27 @@ config("no_rtti") {
}
}
+# Exceptions -------------------------------------------------------------------
+
+# Some code requires turning exceptions back on (off is the default).
+
+config("no_exceptions") {
+ if (is_win) {
+ defines = [ "_HAS_EXCEPTIONS=0" ]
+ } else if (is_posix) {
+ cflags_cc = [ "-fno-exceptions" ]
+ }
+}
+
+config("exceptions") {
+ if (is_win) {
+ cflags = [
+ "/EHsc", # Assume C functions can't throw exceptions and don't catch
+ # structured exceptions (only C++ ones).
+ ]
+ }
+}
+
# Warnings ---------------------------------------------------------------------
#
# This is where we disable various warnings that we've decided aren't

Powered by Google App Engine
This is Rietveld 408576698