From 96027f0f0971298712fa3715f1f06a2dbccc68c5 Mon Sep 17 00:00:00 2001 From: PixelyIon Date: Sun, 31 Oct 2021 03:16:21 +0530 Subject: [PATCH] Build libraries with `-Ofast` for debug builds To offset some of the performance overhead of using debug builds, we now optimize all libraries using `-Ofast` while building Skyline itself with `-O0`. --- app/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index c47b12cc..fd5ae191 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -12,6 +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") 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 +set(CMAKE_CXX_FLAGS_DEBUG "-Ofast") + # libcxx set(ANDROID_STL "none") set(LIBCXX_INCLUDE_TESTS OFF) @@ -95,6 +98,9 @@ set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_MULTITHREADED ON) add_subdirectory("libraries/boost") +# Build Skyline with full debugging data and -Og for debug builds +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -glldb -gdwarf-5") + # Skyline add_library(skyline SHARED ${source_DIR}/emu_jni.cpp