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

CMake: Turn On Warnings as Errors #12270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.22.1)
cmake_minimum_required(VERSION 3.24)

list(APPEND CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
Expand Down Expand Up @@ -64,6 +64,7 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)

set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release")
if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -110,6 +111,12 @@ endif()

set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)

if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

#######################################################
# Qt6 Configuration
#######################################################
Expand Down
4 changes: 4 additions & 0 deletions src/AnalyzeView/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ endif()

#===========================================================================#

set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)

set(MINIMUM_EXIV2_VERSION 0.28.2)

if(NOT QGC_BUILD_DEPENDENCIES)
Expand Down Expand Up @@ -139,6 +141,8 @@ endif()

target_sources(AnalyzeView PRIVATE ExifParser.cc ExifParser.h)

set(CMAKE_COMPILE_WARNING_AS_ERROR ON)

#===========================================================================#

# qt_add_qml_module(AnalyzeView
Expand Down
Loading