OSDN Git Service

Rollback debug specific changes to build files
authorAlexis Hetu <sugoi@google.com>
Tue, 8 Aug 2017 12:31:13 +0000 (08:31 -0400)
committerAlexis Hétu <sugoi@google.com>
Tue, 8 Aug 2017 12:31:55 +0000 (12:31 +0000)
There's an issue with the new debug specific path in the build files.
Rolling back these changes in order to do the DEPS roll while the
investigation on this issue continues.

Change-Id: I9c2174d3ec2ab4e8f817c7cae32f69af1728c6c2
Reviewed-on: https://swiftshader-review.googlesource.com/11328
Reviewed-by: Alexis Hétu <sugoi@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
BUILD.gn
src/OpenGL/libEGL/BUILD.gn
src/swiftshader.gni

index 7530b91..f6c0699 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -31,27 +31,46 @@ config("swiftshader_config") {
       "NOMINMAX",
       "_WINDLL",
       "NO_SANITIZE_FUNCTION=",
-      "ANGLE_DISABLE_TRACE",
     ]
+
+    if (is_debug) {
+      cflags += [ "/RTC1" ]  # Run-Time Error Checks
+    } else {
+      defines += [ "ANGLE_DISABLE_TRACE" ]
+    }
   } else {
     cflags = [
       "-std=c++11",
       "-fno-exceptions",
       "-fno-operator-names",
-      "-ffunction-sections",
-      "-fdata-sections",
-      "-fomit-frame-pointer",
-      "-Os",
     ]
 
     defines += [
       "__STDC_CONSTANT_MACROS",
       "__STDC_LIMIT_MACROS",
       "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))",
-      "ANGLE_DISABLE_TRACE",
-      "NDEBUG",
     ]
 
+    if (is_debug) {
+      cflags += [
+        "-g",
+        "-g3",
+      ]
+    } else {  # Release
+      # All Release builds use function/data sections to make the shared libraries smaller
+      cflags += [
+        "-ffunction-sections",
+        "-fdata-sections",
+        "-fomit-frame-pointer",
+        "-Os",
+      ]
+
+      defines += [
+        "ANGLE_DISABLE_TRACE",
+        "NDEBUG",
+      ]
+    }
+
     if (target_cpu == "x64") {  # 64 bit version
       cflags += [
         "-m64",
index 543c9cc..68a10bc 100644 (file)
@@ -58,6 +58,10 @@ swiftshader_shared_library("swiftshader_libEGL") {
     "resource.h",
   ]
 
+  if (is_debug) {
+    sources += [ "../common/debug.cpp" ]
+  }
+
   if (is_mac) {
     sources += [ "OSXUtils.mm" ]
     libs = [
index 253d405..5bb7875 100644 (file)
@@ -12,22 +12,6 @@ if (is_win) {
   configs_to_delete += [ "//build/config/win:unicode" ]
 }
 
-if (is_debug) {
-  # always build release version of SwiftShader for performance reasons
-  configs_to_delete += [
-    "//build/config:debug",
-    "//build/config/compiler:default_optimization",
-  ]
-  configs_to_add += [
-    "//build/config:release",
-    "//build/config/compiler:optimize",
-  ]
-  if (is_win) {
-    configs_to_delete += [ "//build/config/win:default_crt" ]
-    configs_to_add += [ "//build/config/win:release_crt" ]
-  }
-}
-
 configs_to_delete += [ "//build/config/compiler:chromium_code" ]
 configs_to_add += [
   "//build/config/compiler:no_chromium_code",