bitcode support requires a few changes
authorMatthew Leibowitz <mattleibow@live.com>
Sat, 6 May 2017 23:23:33 +0000 (19:23 -0400)
committerMatthew Leibowitz <mattleibow@live.com>
Sat, 6 May 2017 23:23:33 +0000 (19:23 -0400)
gn/BUILD.gn

index 8dbf5fc..b3483dd 100644 (file)
@@ -29,6 +29,11 @@ declare_args() {
 
   cc_wrapper = ""
   malloc = ""
+
+  enable_bitcode = false
+  if (is_tvos) {
+    enable_bitcode = true
+  }
 }
 
 if (host_os == "win") {
@@ -235,11 +240,6 @@ config("default") {
       "-arch",
       _target,
     ]
-    if (is_tvos) {
-      cflags += [
-        "-fembed-bitcode"
-      ]
-    }
     cflags_cc += [ "-stdlib=libc++" ]
     ldflags += [
       "-isysroot",
@@ -251,6 +251,12 @@ config("default") {
     libs += [ "objc" ]
   }
 
+  if (enable_bitcode) {
+    cflags += [
+      "-fembed-bitcode"
+    ]
+  }
+
   if (is_linux) {
     libs += [ "pthread" ]
   }
@@ -438,10 +444,14 @@ config("release") {
   } else {
     cflags = [
       "-Os",
-      "-fdata-sections",
-      "-ffunction-sections",
       "-momit-leaf-frame-pointer",
     ]
+    if (!enable_bitcode) {
+      cflags += [
+        "-fdata-sections",
+        "-ffunction-sections",
+      ]
+    }
     if (is_mac || is_ios) {
       ldflags = [ "-dead_strip" ]
     } else {