mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-28 07:36:44 -04:00
set default CMake build type to RelWithDebInfo
This enables both optimizations (-O2) and debug symbols (-g), so strip the latter during the install rule. While at it, increase verbosity for the default build.
This commit is contained in:
parent
38a869a785
commit
2653a44a4c
@ -9,9 +9,10 @@ if [ "$ANALYZE" = "true" ] ; then
|
|||||||
exit $RET
|
exit $RET
|
||||||
else
|
else
|
||||||
set -e
|
set -e
|
||||||
|
export VERBOSE=1
|
||||||
mkdir build && cd build
|
mkdir build && cd build
|
||||||
cmake -G "Unix Makefiles" ..
|
cmake -G "Unix Makefiles" ..
|
||||||
make
|
make
|
||||||
make install DESTDIR=/tmp/whatever
|
make install/strip DESTDIR=/tmp/whatever
|
||||||
make package
|
make package
|
||||||
fi
|
fi
|
||||||
|
@ -12,6 +12,17 @@ project("Woof"
|
|||||||
HOMEPAGE_URL "https://github.com/fabiangreffrath/woof"
|
HOMEPAGE_URL "https://github.com/fabiangreffrath/woof"
|
||||||
LANGUAGES C)
|
LANGUAGES C)
|
||||||
|
|
||||||
|
# Set a default build type if none was specified
|
||||||
|
set(default_build_type "RelWithDebInfo")
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
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 the possible values of build type for cmake-gui
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
||||||
|
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Prevent in-tree builds.
|
# Prevent in-tree builds.
|
||||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
|
||||||
message(FATAL_ERROR "In-tree builds are not supported.")
|
message(FATAL_ERROR "In-tree builds are not supported.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user