summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPino Toscano <pino@kde.org>2010-03-22 21:49:22 +0100
committerPino Toscano <pino@kde.org>2010-03-22 21:49:22 +0100
commit86debcc9bba28a7c86f01ca9e63bde5fcd541846 (patch)
tree7dbe9c33068b37a25b9ffbae919accec58a1d7b7 /cmake
parent0819acd52a2ce74f0e176626d7b2233e10232d53 (diff)
[CMake] add "-ansi" to the CXXFLAGS only on Linux
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/PopplerMacros.cmake9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/modules/PopplerMacros.cmake b/cmake/modules/PopplerMacros.cmake
index 36515629..fad51529 100644
--- a/cmake/modules/PopplerMacros.cmake
+++ b/cmake/modules/PopplerMacros.cmake
@@ -101,8 +101,8 @@ endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
if(CMAKE_COMPILER_IS_GNUCXX)
# set the default compile warnings
set(DEFAULT_COMPILE_WARNINGS_NO)
- set(DEFAULT_COMPILE_WARNINGS_YES "-ansi -Wall -Wno-write-strings")
- set(DEFAULT_COMPILE_WARNINGS_KDE "-Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -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(DEFAULT_COMPILE_WARNINGS_YES "-Wall -Wno-write-strings")
+ set(DEFAULT_COMPILE_WARNINGS_KDE "-Wno-long-long -Wundef -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -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_CXX_FLAGS "-Wnon-virtual-dtor -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
@@ -116,6 +116,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline")
set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+ if(CMAKE_SYSTEM_NAME MATCHES Linux)
+ set(DEFAULT_COMPILE_WARNINGS_YES "${DEFAULT_COMPILE_WARNINGS_YES} -ansi")
+ set(DEFAULT_COMPILE_WARNINGS_KDE "${DEFAULT_COMPILE_WARNINGS_KDE} -ansi")
+ endif(CMAKE_SYSTEM_NAME MATCHES Linux)
+
poppler_check_link_flag("-Wl,--as-needed" GCC_HAS_AS_NEEDED)
if(GCC_HAS_AS_NEEDED)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")