summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-28 11:04:48 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-28 11:25:06 -0300
commit0eb416d487ae381a78fe99498a5217e9f24d7413 (patch)
tree8f35dc303c6af12f014614ed0c604c47025dd8c4 /CMakeLists.txt
parent43ec6577661dd468ba8f6c841b3fe90537a951eb (diff)
Disabled GCC optimization flags by default.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt34
1 files changed, 20 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 02ac0365..fed56f6d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,25 +4,31 @@ project(pysidebindings)
cmake_minimum_required(VERSION 2.6)
-set(CMAKE_CXX_FLAGS_RELEASE "-Wall -DNDEBUG -Os -Wno-strict-aliasing -fvisibility=hidden")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -fno-common -Wall -fno-strict-aliasing -fvisibility=hidden")
-
-if (CMAKE_HOST_UNIX)
- if (CMAKE_HOST_APPLE)
- if (NOT QT_INCLUDE_DIR)
- set(QT_INCLUDE_DIR "/Library/Frameworks")
- endif ()
- else ()
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-O1 -Wl,--hash-style=gnu")
- endif ()
-endif ()
+if(CMAKE_HOST_UNIX)
+ option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimization library size and performance. Only available on Release Mode" 0)
+ set(CMAKE_CXX_FLAGS "-Wall -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g")
+ if(ENABLE_GCC_OPTIMIZATION)
+ set(CMAKE_BUILD_TYPE Release)
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -Wno-strict-aliasing -Wl,-O1")
+ if(NOT CMAKE_HOST_APPLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--hash-style=gnu")
+ endif()
+ endif()
-if (NOT CMAKE_BUILD_TYPE)
+ if(CMAKE_HOST_APPLE)
+ if (NOT QT_INCLUDE_DIR)
+ set(QT_INCLUDE_DIR "/Library/Frameworks")
+ endif()
+ endif()
+endif()
+
+if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
option(AVOID_PROTECTED_HACK "Avoid protected hack on generated bindings." FALSE)
-if (AVOID_PROTECTED_HACK OR WIN32)
+if(AVOID_PROTECTED_HACK OR WIN32)
add_definitions(-DAVOID_PROTECTED_HACK)
message(STATUS "Avoiding protected hack!")
endif()