Skip to content

Commit

Permalink
few improvements for UNIX build
Browse files Browse the repository at this point in the history
  • Loading branch information
karolherbst committed Mar 10, 2012
1 parent f04db3f commit e6c6475
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Expand Up @@ -7,6 +7,7 @@
# global options:
# BRANDING branding_default The branding to use for Desurium.
# possible values: branding_default, branding_desura
# DEBUG OFF will add debug symbols and other debugging stuff
#
# unix-only options:
# WITH_ARES ON build CURL with ares support (c-ares REQUIRED)
Expand All @@ -21,8 +22,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
set(CMAKE_PLATFORM_PATH "${CMAKE_SOURCE_DIR}/cmake/platform")
set(CMAKE_EXTERNAL_BINARY_DIR "${CMAKE_BINARY_DIR}/external")

if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
if(DEBUG)
set(CMAKE_BUILD_TYPE Debug)
else()
set(CMAKE_BUILD_TYPE Release)
endif()

include(CheckOptions)
Expand Down
1 change: 1 addition & 0 deletions cmake/modules/CheckOptions.cmake
Expand Up @@ -4,6 +4,7 @@

set(BRANDING "branding_default"
CACHE STRING "The branding to use for Desurium.")
option(DEBUG "enable debug build" OFF)

###############################################################################
# unix-only options
Expand Down
13 changes: 7 additions & 6 deletions cmake/platform/unix/platform.cmake
Expand Up @@ -9,14 +9,15 @@ add_definitions(-DBOOST_FILESYSTEM_VERSION=2 -D_LARGE_FILES
# some compiler flags
###############################################################################

if(CMAKE_BUILD_TYPE MATCHES "Debug")
# TODO: if DEBUG is not defined, the binary will be copied
#if(DEBUG)
add_definitions(-DDEBUG)
else()
add_definitions(-DNDEBUG)
endif()
#else()
# add_definitions(-DNDEBUG)
#endif()

add_compiler_flags(-fPIC -pipe -fvisibility=hidden -Wl,-Bsymbolic-functions -lpthread -g3)
add_compiler_flags(DEBUG -rdynamic -fno-omit-frame-pointer)
add_compiler_flags(-fPIC -pipe -fvisibility=hidden -Wl,-Bsymbolic-functions -lpthread -finline-functions)
add_compiler_flags(DEBUG -rdynamic -fno-omit-frame-pointer -g3)
add_compiler_flags(RELEASE -O2)

add_compiler_flags(CXX -fpermissive)
Expand Down

0 comments on commit e6c6475

Please sign in to comment.