-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea79af5
commit 41efb7d
Showing
2 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Allow user override and multi-configuration generators | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
# Set build type if none was specified, git checkouts default to debug | ||
set(default_build_type "Release") | ||
if(EXISTS "${CMAKE_SOURCE_DIR}/.git") | ||
set(default_build_type "Debug") | ||
endif() | ||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.") | ||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE) | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") | ||
else() | ||
message(STATUS "Build type is set to ${CMAKE_BUILD_TYPE}.") | ||
endif() | ||
|
||
# Ensure needed debugging flags are passed | ||
add_compile_definitions($<$<CONFIG:Debug>:_DEBUG>$<$<CONFIG:Release,MinSizeRel,RelWithDebInfo>:NDEBUG>) | ||
|
||
# Since dkp is disabling default flags, add optimizing here | ||
if(NINTENDO_WII OR NINTENDO_3DS OR NINTENDO_SWITCH) | ||
foreach(lang C CXX ASM) | ||
string(APPEND CMAKE_${lang}_FLAGS_DEBUG " -g -O0") | ||
string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL " -Os") | ||
string(APPEND CMAKE_${lang}_FLAGS_RELEASE " -O3") | ||
string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO " -g -O2") | ||
endforeach() | ||
endif() |