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

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

Issue 21983003: Make the Mac build work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dunnow Created 7 years, 4 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
« no previous file with comments | « tools/gn/secondary/build/config/clang/BUILD.gn ('k') | tools/gn/secondary/build/config/mac/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/secondary/build/config/compiler/BUILD.gn
diff --git a/tools/gn/secondary/build/config/compiler/BUILD.gn b/tools/gn/secondary/build/config/compiler/BUILD.gn
index 43bee6e9035882771749f89d7ef9ac7d40abf0b2..04f73e077dc5617da084c4cf9572ff3f4b9907cc 100644
--- a/tools/gn/secondary/build/config/compiler/BUILD.gn
+++ b/tools/gn/secondary/build/config/compiler/BUILD.gn
@@ -20,7 +20,7 @@ config("compiler") {
"-fno-threadsafe-statics",
"-fstack-protector-all",
- "-fvisibility-hidden",
+ "-fvisibility=hidden",
"-fvisibility-inlines-hidden",
]
# !!! Please keep additions sorted alphabetically.
@@ -43,13 +43,35 @@ config("compiler") {
}
if (is_mac) {
- cflags += [
+ # These are used for both compiler and linker flags on Mac.
+ common_mac_flags = [
+ # TODO(brettw) obviously this needs to be parameterized.
+ "-arch i386",
+
# Set which SDK to use.
# TODO(brettw) this needs to be configurable somehow.
"-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk",
"-mmacosx-version-min=10.6",
]
+
+ # Mac compiler flags.
+ cflags += [
+ # Without this, the constructors and destructors of a C++ object inside
+ # an Objective C struct won't be called, which is very bad.
+ "-fobjc-call-cxx-cdtors",
+ ]
+ cflags += common_mac_flags
+
+ # Mac linker flags.
+ ldflags = [
+ "-L.",
+
+ # TODO(brettW) I don't understand these options.
+ "-Wl,-rpath,@loader_path/.",
+ "-Wl,-rpath,@loader_path/../../..",
+ ]
+ ldflags += common_mac_flags
}
}
@@ -114,6 +136,7 @@ config("chromium_code") {
]
} else if (is_mac) {
cflags = [
+ "-Wall",
"-Werror",
"-Wextra",
]
« no previous file with comments | « tools/gn/secondary/build/config/clang/BUILD.gn ('k') | tools/gn/secondary/build/config/mac/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698