mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
cmake: Add dolphin_compile_definitions function
This is similar to add_definitions, but supports generator expressions. It also has an optional argument to add only to Debug or Release configurations.
This commit is contained in:
@ -79,6 +79,7 @@ list(APPEND CMAKE_MODULE_PATH
|
||||
# Support functions
|
||||
include(CheckAndAddFlag)
|
||||
include(CheckCCompilerFlag)
|
||||
include(DolphinCompileDefinitions)
|
||||
|
||||
# Libraries to link
|
||||
set(LIBS)
|
||||
@ -193,6 +194,7 @@ endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||
check_and_add_flag(EXCEPTIONS /EHsc)
|
||||
dolphin_compile_definitions(-D_DEBUG DEBUG_ONLY)
|
||||
|
||||
# Only MSBuild needs this, other generators will compile one file at a time
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
@ -226,6 +228,8 @@ else()
|
||||
check_and_add_flag(VISIBILITY_HIDDEN -fvisibility=hidden)
|
||||
|
||||
check_and_add_flag(FOMIT_FRAME_POINTER -fomit-frame-pointer RELEASE_ONLY)
|
||||
|
||||
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
|
||||
check_and_add_flag(GGDB -ggdb DEBUG_ONLY)
|
||||
|
||||
if(NOT ANDROID AND _M_X86_64)
|
||||
@ -334,7 +338,6 @@ endif()
|
||||
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-D_DEBUG)
|
||||
|
||||
option(ENABLE_GPROF "Enable gprof profiling (must be using Debug build)" OFF)
|
||||
if(ENABLE_GPROF)
|
||||
|
Reference in New Issue
Block a user