endif()
include(GNUInstallDirs)
+include(CheckCXXCompilerFlag)
include(CheckIncludeFileCXX)
include(CheckTypeSize)
include(CMakePushCheckState)
set(KATIE_HEX "0x040902")
set(KATIE_VERSION "${KATIE_MAJOR}.${KATIE_MINOR}.${KATIE_MICRO}")
+set(KATIE_NO_WARNINGS
+ # placement new used in private QVariant constructor functions
+ -Wno-placement-new
+ # QVector does not always use new/delete
+ -Wno-class-memaccess
+ # hot attribute used in function prototypes
+ -Wno-attributes
+ # deprecated X11, CUPS and OpenSSL API used
+ -Wno-deprecated -Wno-deprecated-declarations
+)
+foreach(nowarning ${KATIE_NO_WARNINGS})
+ string(REPLACE "-W" "" normalizednowarning "${nowarning}")
+ check_cxx_compiler_flag(${nowarning} CXX_${normalizednowarning})
+ if(CXX_${normalizednowarning})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${nowarning}")
+ endif()
+endforeach()
+
# only for the build process
if(CMAKE_SYSTEM_PROCESSOR)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" KATIE_PROCESSOR)
libicu-dev unixodbc-dev libpq-dev libmariadbclient-dev libmariadbd-dev liblz4-dev \
libsqlite3-dev xorg-dev dbus-x11
- export CFLAGS="$CFLAGS -w"
-
- export CXXFLAGS="$CXXFLAGS -w"
-
cmake . -Wno-dev -DKATIE_TESTS=ON -DKATIE_BENCHMARKS=ON -DKATIE_UTILS=ON -DKATIE_PCH=ON -DCMAKE_UNITY_BUILD=ON
make -j $(nproc || echo 1)
# using MATCHES in all checks due to CMP0054
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
- elseif(CMAKE_CXX_COMPILER_ID MATCHES "(Clang|AppleClang)")
+ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message(FATAL_ERROR "Unknown compiler '${CMAKE_CXX_COMPILER_ID}'")