Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / build / config / BUILDCONFIG.gn
index 3df338d..dfa9c3b 100644 (file)
@@ -31,7 +31,7 @@ declare_args() {
 
   # Set to true when compiling with the Clang compiler. Typically this is used
   # to configure warnings.
-  is_clang = false
+  is_clang = (os == "mac" || os == "ios" || os == "linux")
 
   # 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.
@@ -101,9 +101,6 @@ if (os == "win") {
   is_nacl = false
   is_posix = true
   is_win = false
-  if (!is_clang) {
-    is_clang = true  # Always use clang on Mac.
-  }
 } else if (os == "android") {
   is_android = true
   is_chromeos = false
@@ -142,10 +139,6 @@ if (os == "win") {
   is_nacl = false
   is_posix = true
   is_win = false
-  if (!is_gyp_xcode_generator) {
-    # Always use clang on iOS when using ninja
-    is_clang = true
-  }
 } else if (os == "linux") {
   is_android = false
   is_chromeos = false
@@ -317,7 +310,9 @@ _native_compiler_configs = [
   "//build/config:feature_flags",
 
   "//build/config/compiler:compiler",
+  "//build/config/compiler:compiler_arm_fpu",
   "//build/config/compiler:chromium_code",
+  "//build/config/compiler:default_include_dirs",
   "//build/config/compiler:default_warnings",
   "//build/config/compiler:no_rtti",
   "//build/config/compiler:runtime_library",
@@ -459,11 +454,21 @@ if (is_win) {
     set_default_toolchain("//build/toolchain/win:32")
   }
 } else if (is_android) {
-  host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
+  # Use clang for the x86/64 Linux host builds.
+  if (build_cpu_arch == "x86" || build_cpu_arch == "x64") {
+    host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch"
+  } else {
+    host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
+  }
   set_default_toolchain("//build/toolchain/android:$cpu_arch")
 } else if (is_linux) {
-  host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
-  set_default_toolchain("//build/toolchain/linux:$cpu_arch")
+  if (is_clang) {
+    host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch"
+    set_default_toolchain("//build/toolchain/linux:clang_$cpu_arch")
+  } else {
+    host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
+    set_default_toolchain("//build/toolchain/linux:$cpu_arch")
+  }
 } else if (is_mac) {
   host_toolchain = "//build/toolchain/mac:clang"
   set_default_toolchain(host_toolchain)