Index: build/config/BUILD.gn |
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn |
index 643d4d9db4c6997e3c47ffb8091abdaa4e9a10b6..2a5a39a92425a6c6d2779d5904f4eef26dba94ba 100644 |
--- a/build/config/BUILD.gn |
+++ b/build/config/BUILD.gn |
@@ -4,6 +4,7 @@ |
import("//build/config/allocator.gni") |
import("//build/config/chrome_build.gni") |
+import("//build/config/chromecast_build.gni") |
import("//build/config/crypto.gni") |
import("//build/config/features.gni") |
import("//build/config/sanitizers/sanitizers.gni") |
@@ -408,6 +409,61 @@ config("default_libs") { |
} |
} |
+# Executable configs ----------------------------------------------------------- |
+ |
+# Windows linker setup for EXEs and DLLs. |
+if (is_win) { |
+ _windows_linker_configs = [ |
+ "//build/config/win:default_incremental_linking", |
+ "//build/config/win:sdk_link", |
+ "//build/config/win:common_linker_setup", |
+ |
+ # Default to console-mode apps. Most of our targets are tests and such |
+ # that shouldn't use the windows subsystem. |
+ "//build/config/win:console", |
+ ] |
+} |
+ |
+# This config defines the configs applied to all executables. |
+config("executable_config") { |
slan
2015/12/07 16:13:32
Hmmm. Though it appears to be legal, (meaning GN t
Dirk Pranke
2015/12/07 21:03:42
This is valid and recommended in some cases.
See
slan
2015/12/07 21:07:47
Thanks for the tip! bcf@, feel free to ignore my s
|
+ configs = [] |
+ |
+ if (is_win) { |
+ configs += _windows_linker_configs |
+ } else if (is_mac) { |
+ configs += [ |
+ "//build/config/mac:mac_dynamic_flags", |
+ "//build/config/mac:mac_executable_flags", |
+ ] |
+ } else if (is_linux || is_android || is_chromecast) { |
slan
2015/12/07 16:13:32
is_chromecast not needed here. The OS flags should
bcf
2015/12/07 21:39:49
Done.
|
+ configs += [ "//build/config/gcc:executable_ldconfig" ] |
+ if (is_android) { |
+ configs += [ "//build/config/android:executable_config" ] |
+ } else if (is_chromecast) { |
+ configs += [ "//build/config/chromecast:executable_config" ] |
+ } |
+ } |
+} |
+ |
+# Shared library configs ------------------------------------------------------- |
+ |
+# This config defines the configs applied to all shared libraries. |
+config("shared_library_config") { |
+ configs = [] |
+ |
+ if (is_win) { |
+ configs += _windows_linker_configs |
+ } else if (is_mac) { |
+ configs += [ "//build/config/mac:mac_dynamic_flags" ] |
+ } else if (is_android) { |
+ # Strip native JNI exports from shared libraries by default. Binaries that |
+ # want this can remove this config. |
+ configs += [ "//build/config/android:hide_native_jni_exports" ] |
+ } else if (is_chromecast) { |
+ configs += [ "//build/config/chromecast:shlib_config" ] |
slan
2015/12/07 16:13:32
nit: Can this be shared_library_config to match th
bcf
2015/12/07 21:39:49
Done.
|
+ } |
+} |
+ |
# Add this config to your target to enable precompiled headers. |
# |
# Precompiled headers are done on a per-target basis. If you have just a couple |