Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings #227

Merged
merged 4 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Multimedia Network OpenGL Con

# Global compiler options
if(MSVC)
add_compile_options(/wd4351 /wd4661)
add_compile_options(/W3 /w34100 /w34189 /wd4661)

# https://doc.qt.io/qt-6/qt-disable-unicode-defines.html
add_compile_definitions(UNICODE)
Expand All @@ -102,15 +102,15 @@ if(MSVC)

# Debug iterators used by Qt 5
add_compile_definitions(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING)
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
add_compile_options(-Wall -Wextra)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX,OBJCXX>:-Woverloaded-virtual;-Wzero-as-null-pointer-constant;-Wsuggest-override>")
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang")
add_compile_options(-Wall -Wextra)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX,OBJCXX>:-Woverloaded-virtual;-Wzero-as-null-pointer-constant;-Wno-return-std-move>")
endif()

if(UNIX AND NOT APPLE)
add_compile_options("-Wno-deprecated")
endif()

if(UNIX)
add_compile_options("-Wno-deprecated-declarations")
endif()
add_compile_definitions(QT_NO_DEPRECATED_WARNINGS)

if(SWIFT_USE_CRASHPAD)
add_compile_definitions(BLACK_USE_CRASHPAD)
Expand All @@ -122,6 +122,11 @@ elseif(UNIX)
set(CMAKE_INSTALL_RPATH \$ORIGIN/../lib)
endif()

if(UNIX AND NOT APPLE AND ${CMAKE_BUILD_TYPE} STREQUAL Debug)
# For BlackMisc::getStackTrace
add_link_options(-rdynamic)
endif()

if(MSVC)
set(CMAKE_DEBUG_POSTFIX d)
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/rapidjson/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1

add_library(externals_rapidjson INTERFACE)
target_include_directories(externals_rapidjson INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include)
target_include_directories(externals_rapidjson SYSTEM INTERFACE ${PROJECT_SOURCE_DIR}/externals/common/include)
6 changes: 6 additions & 0 deletions src/xswiftbus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ if(MSVC)
target_compile_definitions(xswiftbus PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()

if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
target_compile_options(xswiftbus PRIVATE -Wno-missing-field-initializers -Wno-stringop-truncation)
elseif(${CMAKE_CXX_COMPILER_ID} MATCHES ".*Clang")
target_compile_options(xswiftbus PRIVATE -Wno-missing-field-initializers)
endif()

if(UNIX AND NOT APPLE)
target_compile_definitions(xswiftbus PUBLIC LIN=1)
elseif(WIN32)
Expand Down