Introduce a releasedebug build variant

This commit is contained in:
lynxnb 2022-10-07 17:05:35 +02:00
parent b17364bb92
commit 6b76c61cd1
2 changed files with 22 additions and 1 deletions

View File

@ -12,8 +12,9 @@ set(source_DIR ${CMAKE_SOURCE_DIR}/src/main/cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -Wno-unused-command-line-argument -fwrapv")
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -flto=full -fno-stack-protector -DNDEBUG")
# Build all libraries with -Ofast but with default debug data (-g) for debug builds
# Build all libraries with -Ofast but with default debug data (-g) for debug and reldebug builds
set(CMAKE_CXX_FLAGS_DEBUG "-Ofast")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Ofast")
# libcxx
set(ANDROID_STL "none")
@ -110,6 +111,8 @@ add_subdirectory("libraries/adrenotools")
# Build Skyline with full debugging data and -Og for debug builds
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -glldb -gdwarf-5 -fno-omit-frame-pointer")
# Build Skyline with full debugging data and some optimizations for reldebug builds, build speed is pioritised
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g3 -glldb -gdwarf-5 -fno-omit-frame-pointer -fno-stack-protector")
# Include headers from libraries as system headers to silence warnings from them
function(target_link_libraries_system target)

View File

@ -73,6 +73,18 @@ android {
signingConfig = isBuildSigned ? signingConfigs.ci : signingConfigs.debug
}
reldebug {
debuggable true
externalNativeBuild {
cmake {
arguments "-DCMAKE_BUILD_TYPE=RELWITHDEBINFO"
}
}
minifyEnabled false
shrinkResources false
signingConfig = isBuildSigned ? signingConfigs.ci : signingConfigs.debug
}
debug {
debuggable true
minifyEnabled false
@ -121,6 +133,12 @@ android {
/* Vulkan Validation Layers */
sourceSets {
reldebug {
jniLibs {
srcDir "libraries/vklayers"
}
}
debug {
jniLibs {
srcDir "libraries/vklayers"