diff --git a/CMakeLists.txt b/CMakeLists.txt index dfda7cb7c..a9dbda4cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -656,19 +656,42 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") ) # Due to a regression in gcc-4.8.X, we need to disable array-bounds check - IF (CMAKE_COMPILER_IS_GNUCXX AND ((CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL "4.8.0") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0") OR LMMS_BUILD_WIN32)) - SET(WERROR_FLAGS "${WERROR_FLAGS} -Wno-array-bounds -Wno-attributes") - ENDIF() -ELSEIF(MSVC) - # Remove any existing /W flags - string(REGEX REPLACE "/W[0-4]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) - STRING(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - SET(WERROR_FLAGS "/W2") - IF(${USE_WERROR}) - SET(WERROR_FLAGS "${WERROR_FLAGS} /WX") - ENDIF() -ENDIF() + # TODO: Is this still necessary? + if(CMAKE_COMPILER_IS_GNUCXX) + list(APPEND COMPILE_ERROR_FLAGS + "-Wno-array-bounds" # Permit out-of-bounds array subscripts + "-Wno-attributes" # Permit unrecognised attributes + ) + endif() + if(USE_WERROR) + list(APPEND COMPILE_ERROR_FLAGS + "-Werror" # Treat warnings as errors + ) + endif() +elseif(MSVC) + set(COMPILE_ERROR_FLAGS + "/W2" # Enable some warnings by default + "/external:W0" # Don't emit warnings for third-party code + "/external:anglebrackets" # Consider headers included with angle brackets to be third-party + "/external:templates-" # Still emit warnings from first-party instantiations of third-party templates + # Silence "class X needs to have DLL-interface to be used by clients of + # class Y" warnings. These aren't trivial to address, and don't pose a + # problem for us since we build all modules with the same compiler and + # options, and dynamically link the CRT. + "/wd4251" + ) + set(THIRD_PARTY_COMPILE_ERROR_FLAGS + "/W0" # Disable all warnings + ) + + if(USE_WERROR) + list(APPEND COMPILE_ERROR_FLAGS + "/WX" # Treat warnings as errors + ) + endif() +endif() +add_compile_options("$>,${THIRD_PARTY_COMPILE_ERROR_FLAGS},${COMPILE_ERROR_FLAGS}>") IF(NOT CMAKE_BUILD_TYPE) message(STATUS "Setting build type to 'Release' as none was specified.") diff --git a/plugins/ZynAddSubFx/CMakeLists.txt b/plugins/ZynAddSubFx/CMakeLists.txt index d9f723961..b3490a50f 100644 --- a/plugins/ZynAddSubFx/CMakeLists.txt +++ b/plugins/ZynAddSubFx/CMakeLists.txt @@ -111,15 +111,6 @@ set_target_properties(zynaddsubfx_nio PROPERTIES SYSTEM TRUE) set_target_properties(zynaddsubfx_gui PROPERTIES SYSTEM TRUE) set_target_properties(zynaddsubfx_synth PROPERTIES SYSTEM TRUE) -<<<<<<< HEAD -if(MINGW) - target_link_libraries(zynaddsubfx_nio PUBLIC mingw_stdthreads) - target_link_libraries(zynaddsubfx_gui PUBLIC mingw_stdthreads) - target_link_libraries(zynaddsubfx_synth PUBLIC mingw_stdthreads) -endif() - -======= ->>>>>>> master # Relative include paths don't work automatically for the GUI, because the # generated C++ files aren't in the source directory. Thus, add the expected # source directory as an additional include directory. diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index e648cfd03..e5cb62527 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -11,15 +11,6 @@ target_include_directories(jack_headers INTERFACE jack2/common) ADD_SUBDIRECTORY(hiir) ADD_SUBDIRECTORY(weakjack) -<<<<<<< HEAD -if(MINGW) - option(MINGW_STDTHREADS_GENERATE_STDHEADERS "" ON) - add_subdirectory(mingw-std-threads) - set(LMMS_USE_MINGW_STD_THREADS ON PARENT_SCOPE) -endif() - -======= ->>>>>>> master # The lockless ring buffer library is linked as part of the core add_library(ringbuffer OBJECT ringbuffer/src/lib/ringbuffer.cpp