Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / build / config / BUILDCONFIG.gn
index 38da66c..d061f0b 100644 (file)
@@ -33,16 +33,6 @@ declare_args() {
   # to configure warnings.
   is_clang = false
 
-  # ASH is enabled.
-  # TODO(brettw) this should be moved out of the main build config file.
-  use_ash = false
-  # Aura is enabled.
-  # TODO(brettw) this should be moved out of the main build config file.
-  use_aura = false
-  # Ozone is enabled.
-  # TODO(brettw) this should be moved out of the main build config file.
-  use_ozone = false
-
   # Forces a 64-bit build on Windows. Does nothing on other platforms. Normally
   # we build 32-bit on Windows regardless of the current host OS bit depth.
   # Setting this flag will override this logic and generate 64-bit toolchains.
@@ -80,6 +70,10 @@ declare_args() {
 
   # When running in gyp-generating mode, this is the root of the build tree.
   gyp_output_dir = "out"
+
+  # When running in gyp-generating mode, this flag indicates if the current GYP
+  # generator is xcode. Can only be true when building for iOS).
+  is_gyp_xcode_generator = false
 }
 
 # =============================================================================
@@ -93,7 +87,8 @@ declare_args() {
 # - is_mac is set only for desktop Mac. It is not set on iOS.
 # - is_posix is true for mac and any Unix-like system (basically everything
 #   except Windows).
-# - is_linux is true for any Linux variant including Android and ChromeOS.
+# - is_linux is true for desktop Linux and ChromeOS, but not Android (which is
+#   generally too different despite being based on the Linux kernel).
 #
 # Do not add more is_* variants here for random lesser-used Unix systems like
 # aix or one of the BSDs. If you need to check these, just check the os value
@@ -108,9 +103,6 @@ if (os == "win") {
   is_nacl = false
   is_posix = false
   is_win = true
-
-  # Windows currelty implies Aura.
-  use_aura = true
 } else if (os == "mac") {
   is_android = false
   is_chromeos = false
@@ -127,7 +119,7 @@ if (os == "win") {
   is_android = true
   is_chromeos = false
   is_ios = false
-  is_linux = true
+  is_linux = false
   is_mac = false
   is_nacl = false
   is_posix = true
@@ -161,9 +153,8 @@ if (os == "win") {
   is_nacl = false
   is_posix = true
   is_win = false
-  if (!is_clang) {
+  if (!is_gyp_xcode_generator) {
     # Always use clang on iOS when using ninja
-    # (which is always true when using GN).
     is_clang = true
   }
 } else if (os == "linux") {
@@ -309,8 +300,6 @@ if (!is_clang && (is_asan || is_lsan || is_tsan || is_msan)) {
   is_clang = true
 }
 
-toolkit_uses_gtk = is_linux
-
 # =============================================================================
 # TARGET DEFAULTS
 # =============================================================================
@@ -323,7 +312,7 @@ toolkit_uses_gtk = is_linux
 # Holds all configs used for making native executables and libraries, to avoid
 # duplication in each target below.
 native_compiler_configs = [
-  "//build/config:my_msvs",  # TODO(brettw) eraseme
+  "//build/config:feature_flags",
 
   "//build/config/compiler:compiler",
   "//build/config/compiler:chromium_code",
@@ -332,10 +321,15 @@ native_compiler_configs = [
   "//build/config/compiler:runtime_library",
 ]
 if (is_win) {
-  native_compiler_configs += [
-    "//build/config/win:sdk",
-  ]
-} else if (is_clang) {
+  native_compiler_configs += [ "//build/config/win:sdk", ]
+} else if (is_linux) {
+  native_compiler_configs += [ "//build/config/linux:sdk", ]
+} else if (is_mac) {
+  native_compiler_configs += [ "//build/config/mac:sdk", ]
+} else if (is_ios) {
+  native_compiler_configs += [ "//build/config/ios:sdk", ]
+}
+if (is_clang) {
   native_compiler_configs += [ "//build/config/clang:find_bad_constructs" ]
 }
 
@@ -387,12 +381,14 @@ if (is_win) {
 }
 
 set_defaults("executable") {
-  configs = native_compiler_configs
+  configs = native_compiler_configs + [
+    "//build/config:default_libs",
+  ]
   if (is_win) {
     configs += windows_linker_configs
   } else if (is_mac) {
     configs += [ "//build/config/mac:mac_dynamic_flags" ]
-  } else if (is_linux) {
+  } else if (is_linux || is_android) {
     configs += [ "//build/config/linux:executable_ldconfig" ]
   }
 }
@@ -402,7 +398,9 @@ set_defaults("static_library") {
 }
 
 set_defaults("shared_library") {
-  configs = native_compiler_configs
+  configs = native_compiler_configs + [
+    "//build/config:default_libs",
+  ]
   if (is_win) {
     configs += windows_linker_configs
   } else if (is_mac) {
@@ -443,7 +441,10 @@ if (is_win) {
 } else if (is_linux) {
   host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
   set_default_toolchain("//build/toolchain/linux:$cpu_arch")
-} else if (is_mac || is_ios) {
+} else if (is_mac) {
   host_toolchain = "//build/toolchain/mac:clang"
   set_default_toolchain(host_toolchain)
+} else if (is_ios) {
+  host_toolchain = "//build/toolchain/mac:host_clang"
+  set_default_toolchain("//build/toolchain/mac:clang")
 }