Skip to content

Commit

Permalink
CMake: Turn On Warnings as Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HTRamsey committed Jan 7, 2025
1 parent 29ca1b0 commit f88a971
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
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

0 comments on commit f88a971

Please sign in to comment.