X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=42bacd81f7ecadc9607035846ec6bed469eb43ed;hp=57b51decea7176fc55be908733fd32f194db3858;hb=90ca2d5de312eaab9fa410d87dae019e63599378;hpb=a43f68a84621d11b61f0e712890a5feb76939553 diff --git a/CMakeLists.txt b/CMakeLists.txt index 57b51dec..42bacd81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,9 @@ if(CMAKE_COMPILER_IS_GNUCXX) if(CXX_W_OVERLOADED_VIRTUAL) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual") endif() + + # Just for miniz + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing") endif(CMAKE_COMPILER_IS_GNUCXX) # ... and for Clang @@ -160,6 +163,8 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-inline") set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline") set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing") endif() # Mac build stuff @@ -237,6 +242,21 @@ if(QT_LRELEASE_EXECUTABLE) endif(QT_LRELEASE_EXECUTABLE) +# zlib for compression, however we can always fall back to miniz +find_package(ZLIB) +if(ZLIB_FOUND) + message(STATUS "Using system zlib for compression") + add_definitions(-DHAVE_ZLIB) + include_directories(${ZLIB_INCLUDE_DIRS}) + set(COMMON_LIBRARIES ${COMMON_LIBRARIES} ${ZLIB_LIBRARIES}) +else() + message(STATUS "zlib NOT found, using bundled miniz for compression") + if(${CMAKE_SIZEOF_VOID_P} EQUAL 4) + message(STATUS "WARNING: This may be slow on 32 bit systems!") + endif() +endif() + + # Execinfo is needed for generating backtraces find_package(ExecInfo) if(EXECINFO_FOUND) @@ -329,6 +349,8 @@ if(BUILD_GUI) # Setup KDE4 support if(WITH_KDE AND NOT WITH_QT5) + # KDE has overzealous CFLAGS making miniz not compile, so save our old flags + set(_cflags ${CMAKE_C_FLAGS}) find_package(KDE4) if(KDE4_FOUND) message(STATUS "Enabling KDE4 integration") @@ -338,6 +360,8 @@ if(BUILD_GUI) set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY} ${KDE4_SOLID_LIBS} ${KDE4_KNOTIFYCONFIG_LIBRARY}) # We always use external icons for KDE4 support, since we use its iconloader rather than our own set(EMBED_DATA OFF) + # Restore our old CFLAGS + set(CMAKE_C_FLAGS ${_cflags}) else(KDE4_FOUND) message(STATUS "KDE4 not found, disabling KDE integration") endif(KDE4_FOUND) @@ -373,6 +397,13 @@ if(BUILD_GUI) else(WITH_PHONON) message(STATUS "Not enabling Phonon support") endif(WITH_PHONON) + + find_package(Libsnore) + if(LIBSNORE_FOUND) + add_definitions(-DHAVE_LIBSNORE) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${LIBSNORE_LIBRARIES}) + set(HAVE_SNORENOTIFY true) + endif(LIBSNORE_FOUND) endif(NOT HAVE_KDE) # Setup libindicate-qt support @@ -401,13 +432,6 @@ if(BUILD_GUI) /System/Library/Frameworks/Foundation.framework ) endif() - -find_package(Libsnore) -if(LIBSNORE_FOUND) - add_definitions(-DHAVE_LIBSNORE -DLIBSNORE_PLUGIN_PATH="${LIBSNORE_PLUGIN_PATH}") - set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${LIBSNORE_LIBRARIES}) - set(HAVE_SNORENOTIFY true) -endif(LIBSNORE_FOUND) endif(BUILD_GUI) # Core-only deps