diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-10-23 23:04:52 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-10-23 23:04:52 (GMT) |
commit | 0945aecc944955304070655458c7e4dc31f5dbfb (patch) | |
tree | 0d28fb4bb6f7f3fb72eaf92264e76123717db5c3 /Modules/FindKDE3.cmake | |
parent | 87dcfb54c446ce4916364c1f8991736ee50534d0 (diff) | |
download | CMake-0945aecc944955304070655458c7e4dc31f5dbfb.zip CMake-0945aecc944955304070655458c7e4dc31f5dbfb.tar.gz CMake-0945aecc944955304070655458c7e4dc31f5dbfb.tar.bz2 |
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.cmake | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index f1545a0..12ab449 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") |