Skip to content

Commit

Permalink
Move warning flags back to local scope
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed May 27, 2020
1 parent 586bd30 commit 5ae776c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,29 +49,6 @@ if(GNU_GCC OR LLVM_CLANG)
add_compile_options(-pipe)
endif()

option(WARNINGS_PEDANTIC "Let the compiler show even more warnings" OFF)
if(MSVC)
if(WARNINGS_PEDANTIC)
add_compile_options(/W4)
else()
add_compile_options(/W3)
endif()
else()
add_compile_options(-Wall -Wextra)
if(WARNINGS_PEDANTIC)
add_compile_options(-pedantic)
endif()
endif()

option(WARNINGS_FATAL "Fail if compiler generates a warning" OFF)
if(WARNINGS_FATAL)
if(MSVC)
add_compile_options(/WX)
else()
add_compile_options(-Werror)
endif()
endif()

# Profiling
if(UNIX AND NOT APPLE)
option(PROFILING "Profiling (e.g. gprof) support" OFF)
Expand Down Expand Up @@ -944,6 +921,29 @@ if(GNU_GCC OR LLVM_CLANG)
)
endif()

option(WARNINGS_PEDANTIC "Let the compiler show even more warnings" OFF)
if(MSVC)
if(WARNINGS_PEDANTIC)
target_compile_options(mixxx-lib PUBLIC /W4)
else()
target_compile_options(mixxx-lib PUBLIC /W3)
endif()
else()
target_compile_options(mixxx-lib PUBLIC -Wall -Wextra)
if(WARNINGS_PEDANTIC)
target_compile_options(mixxx-lib PUBLIC -pedantic)
endif()
endif()

option(WARNINGS_FATAL "Fail if compiler generates a warning" OFF)
if(WARNINGS_FATAL)
if(MSVC)
target_compile_options(mixxx-lib PUBLIC /WX)
else()
target_compile_options(mixxx-lib PUBLIC -Werror)
endif()
endif()

option(DEBUG_ASSERTIONS_FATAL "Fail if debug become true assertions" OFF)
if(DEBUG_ASSERTIONS_FATAL)
target_compile_definitions(mixxx-lib PUBLIC MIXXX_DEBUG_ASSERTIONS_FATAL)
Expand Down
2 changes: 1 addition & 1 deletion lib/libshout/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ add_library(shout_mixxx STATIC
)

target_compile_definitions(shout_mixxx PRIVATE HAVE_CONFIG_H)
target_compile_options(shout_mixxx PRIVATE -pthread)
target_compile_options(shout_mixxx PRIVATE -pthread -Wall)

target_link_libraries(shout_mixxx ogg vorbis theora speex OpenSSL::SSL OpenSSL::Crypto)

Expand Down

0 comments on commit 5ae776c

Please sign in to comment.