mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-02 13:01:18 +12:00
Remove PUBLIC_RELEASE flag and tie asserts to debug config (#287)
Removes the -DPUBLIC_RELEASE flag. Cemu's debug asserts are now only enabled if the build configuration is Debug. Similarly, on Windows the console is only shown for Debug builds.
This commit is contained in:
parent
b720d17a97
commit
3bceb39966
68 changed files with 154 additions and 186 deletions
|
@ -1,6 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.21.1)
|
||||
|
||||
option(PUBLIC_RELEASE "Compile with debug asserts disabled and no console" OFF)
|
||||
option(ENABLE_VCPKG "Enable the vcpkg package manager" ON)
|
||||
set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version
|
||||
|
||||
|
@ -29,13 +28,14 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if (PUBLIC_RELEASE)
|
||||
add_compile_definitions(PUBLIC_RELEASE)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) # enable LTO
|
||||
endif()
|
||||
add_compile_definitions($<$<CONFIG:Debug>:CEMU_DEBUG_ASSERT>) # if build type is debug, set CEMU_DEBUG_ASSERT
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# enable link time optimization for release builds
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO ON)
|
||||
|
||||
if (MSVC)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT CemuBin)
|
||||
# floating point model: precise, fiber safe optimizations
|
||||
|
@ -48,10 +48,9 @@ if (MSVC)
|
|||
else()
|
||||
add_compile_options(/GT)
|
||||
endif()
|
||||
if (PUBLIC_RELEASE)
|
||||
message(STATUS "Using additional optimization flags for MSVC")
|
||||
add_compile_options(/Oi /Ot) # enable intrinsic functions, favor speed
|
||||
endif()
|
||||
# enable additional optimization flags for release builds
|
||||
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Oi>) # enable intrinsic functions
|
||||
add_compile_options($<$<CONFIG:Release,RelWithDebInfo>:/Ot>) # favor speed
|
||||
endif()
|
||||
|
||||
if (APPLE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue