Produce less debug info in Kokoro builds
On a 4-core Linux VM it has the following effect:
LESS_DEBUG_INFO=0
real 20m13.051s
user 63m45.648s
sys 6m51.636s
745.8 MB libvk_swiftshader.so
13 GB build dir
LESS_DEBUG_INFO=1
real 15m2.821s
user 51m8.659s
sys 5m17.466s
197.8 MB libvk_swiftshader.so
3.1 GB build dir
Also use /DEBUG:FASTLINK on Visual Studio. It disables producing a
single .pdb which can be relocated.
Specifying LESS_DEBUG_INFO=1 has no effect on Windows currently, but is
done for consistency and in case we start using Clang on Windows.
Also color errors in presubmit consistently.
Bug: b/147735529
Change-Id: Ieb5c84c192178653f74043daf3d8ee599d3ecf6b
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40228
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dd7fdc4..2a4b400 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.6.3)
+cmake_minimum_required(VERSION 3.6.3)
set(CMAKE_CXX_STANDARD 14)
@@ -344,6 +344,9 @@
add_definitions(-D_SBCS) # Single Byte Character Set (ASCII)
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) # Disable MSVC warnings about std::aligned_storage being broken before VS 2017 15.8
+ set_cpp_flag("/DEBUG:FASTLINK" DEBUG)
+ set_cpp_flag("/DEBUG:FASTLINK" RELWITHDEBINFO)
+
if(SWIFTSHADER_WARNINGS_AS_ERRORS)
set_cpp_flag("/WX") # Treat all warnings as errors
endif()
@@ -374,7 +377,6 @@
"/we4838" # conversion from 'type_1' to 'type_2' requires a narrowing conversion
"/we5038" # data member 'member1' will be initialized after data member 'member2' data member 'member' will be initialized after base class 'base_class'
)
-
else()
set_cpp_flag("-fno-exceptions")