summaryrefslogtreecommitdiff
path: root/Modules/FindKDE3.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2006-10-23 19:04:52 -0400
committerAlexander Neundorf <neundorf@kde.org>2006-10-23 19:04:52 -0400
commit0945aecc944955304070655458c7e4dc31f5dbfb (patch)
tree0d28fb4bb6f7f3fb72eaf92264e76123717db5c3 /Modules/FindKDE3.cmake
parent87dcfb54c446ce4916364c1f8991736ee50534d0 (diff)
downloadcmake-0945aecc944955304070655458c7e4dc31f5dbfb.tar.gz
BUG: fix #3955: add -O2 by default but only if no special buildtype is set
Alex
Diffstat (limited to 'Modules/FindKDE3.cmake')
-rw-r--r--Modules/FindKDE3.cmake14
1 files changed, 10 insertions, 4 deletions
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index f1545a02b3..12ab4491e6 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -83,16 +83,22 @@ SET(KDE3_DEFINITIONS -DQT_CLEAN_NAMESPACE -D_GNU_SOURCE)
#only on linux, but NOT e.g. on FreeBSD:
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET (KDE3_DEFINITIONS ${KDE3_DEFINITIONS} -D_XOPEN_SOURCE=500 -D_BSD_SOURCE)
- SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-common")
- SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -fno-exceptions -fno-check-new -fno-common")
+ SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+ SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-exceptions -fno-check-new -fno-common")
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# works on FreeBSD, NOT tested on NetBSD and OpenBSD
IF (CMAKE_SYSTEM_NAME MATCHES BSD)
- SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-common")
- SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -O2 -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
+ SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+ SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common")
ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD)
+# if no special buildtype is selected, add -O2 as default optimization
+IF (NOT CMAKE_BUILD_TYPE)
+ SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
+ SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
+ENDIF (NOT CMAKE_BUILD_TYPE)
+
#SET(CMAKE_SHARED_LINKER_FLAGS "-avoid-version -module -Wl,--no-undefined -Wl,--allow-shlib-undefined")
#SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")