mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
cmake: Disable warnings for most externals on MSVC, like we do in the VS project files.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
include(RemoveCompileFlag)
|
||||
|
||||
macro(dolphin_disable_warnings_msvc _target)
|
||||
if (MSVC)
|
||||
get_target_property(_target_cxx_flags ${_target} COMPILE_OPTIONS)
|
||||
if (_target_cxx_flags)
|
||||
set(new_flags "")
|
||||
foreach(flag IN LISTS _target_cxx_flags)
|
||||
# all warning flags start with "/W" or "/w" or "-W" or "-w"
|
||||
if (NOT "${flag}" MATCHES "^[-/][Ww]")
|
||||
list(APPEND new_flags "${flag}")
|
||||
endif()
|
||||
endforeach()
|
||||
set_target_properties(${_target} PROPERTIES COMPILE_OPTIONS "${new_flags}")
|
||||
endif()
|
||||
target_compile_options(${_target} PRIVATE "/W0")
|
||||
endif()
|
||||
endmacro()
|
||||
@@ -128,6 +128,7 @@ include(CheckAndAddFlag)
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckVendoringApproved)
|
||||
include(DolphinCompileDefinitions)
|
||||
include(DolphinDisableWarningsMSVC)
|
||||
include(RemoveCompileFlag)
|
||||
|
||||
# Enable folders for IDE
|
||||
|
||||
+1
@@ -4,6 +4,7 @@ add_library(bdisasm STATIC
|
||||
resolve.cc
|
||||
syntax.cc
|
||||
)
|
||||
dolphin_disable_warnings_msvc(bdisasm)
|
||||
|
||||
if (WIN32)
|
||||
target_sources(bdisasm
|
||||
|
||||
+1
@@ -12,5 +12,6 @@ set(SRCS
|
||||
)
|
||||
|
||||
add_library(FreeSurround STATIC ${SRCS})
|
||||
dolphin_disable_warnings_msvc(FreeSurround)
|
||||
target_include_directories(FreeSurround PUBLIC include)
|
||||
target_compile_options(FreeSurround PRIVATE -w)
|
||||
|
||||
Vendored
+1
@@ -1,6 +1,7 @@
|
||||
add_library(lzo2 STATIC
|
||||
minilzo.c
|
||||
)
|
||||
dolphin_disable_warnings_msvc(lzo2)
|
||||
|
||||
target_include_directories(lzo2
|
||||
PUBLIC
|
||||
|
||||
Vendored
+2
@@ -25,3 +25,5 @@ set(SRC_SYSTEM
|
||||
|
||||
add_library(sfml-network ${SRC_NETWORK})
|
||||
add_library(sfml-system ${SRC_SYSTEM})
|
||||
dolphin_disable_warnings_msvc(sfml-network)
|
||||
dolphin_disable_warnings_msvc(sfml-system)
|
||||
|
||||
Vendored
+1
@@ -70,6 +70,7 @@ set(BZIP2_SRCS
|
||||
|
||||
add_library(bzip2 STATIC ${BZIP2_SRCS} ${BZIP2_PUBLIC_HDRS} ${BZIP2_PRIVATE_HDRS})
|
||||
add_library(BZip2::BZip2 ALIAS bzip2)
|
||||
dolphin_disable_warnings_msvc(bzip2)
|
||||
|
||||
target_include_directories(bzip2
|
||||
PUBLIC
|
||||
|
||||
+1
@@ -3,4 +3,5 @@ check_and_add_flag(CXX11 -std=c++11)
|
||||
set(SRCS OptionParser.cpp OptionParser.h)
|
||||
|
||||
add_library(cpp-optparse STATIC ${SRCS})
|
||||
dolphin_disable_warnings_msvc(cpp-optparse)
|
||||
target_include_directories(cpp-optparse PUBLIC .)
|
||||
|
||||
Vendored
+2
@@ -48,6 +48,7 @@ add_library(cubeb
|
||||
src/cubeb_log.cpp
|
||||
src/cubeb_strings.c
|
||||
$<TARGET_OBJECTS:speex>)
|
||||
dolphin_disable_warnings_msvc(cubeb)
|
||||
target_include_directories(cubeb
|
||||
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include>
|
||||
)
|
||||
@@ -100,6 +101,7 @@ install(
|
||||
|
||||
add_library(speex OBJECT
|
||||
src/speex/resample.c)
|
||||
dolphin_disable_warnings_msvc(speex)
|
||||
set_target_properties(speex PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||
target_compile_definitions(speex PRIVATE OUTSIDE_SPEEX)
|
||||
target_compile_definitions(speex PRIVATE FLOATING_POINT)
|
||||
|
||||
Vendored
+1
@@ -12,6 +12,7 @@ add_library(
|
||||
STATIC
|
||||
${SRCS}
|
||||
)
|
||||
dolphin_disable_warnings_msvc(curl)
|
||||
|
||||
target_link_libraries(curl ${MBEDTLS_LIBRARIES} z)
|
||||
target_compile_definitions(curl PUBLIC CURL_STATICLIB PRIVATE CURL_DISABLE_LDAP)
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ if(WIN32)
|
||||
add_definitions(-DDISCORD_WINDOWS)
|
||||
set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_win.cpp discord_register_win.cpp)
|
||||
add_library(discord-rpc ${BASE_RPC_SRC})
|
||||
dolphin_disable_warnings_msvc(discord-rpc)
|
||||
if (MSVC)
|
||||
if(USE_STATIC_CRT)
|
||||
foreach(CompilerFlag
|
||||
|
||||
Vendored
+1
@@ -11,3 +11,4 @@ add_library(ed25519
|
||||
sc.c
|
||||
sha512.c
|
||||
verify.c)
|
||||
dolphin_disable_warnings_msvc(ed25519)
|
||||
|
||||
Vendored
+1
@@ -72,6 +72,7 @@ add_library(enet STATIC
|
||||
unix.c
|
||||
win32.c
|
||||
)
|
||||
dolphin_disable_warnings_msvc(enet)
|
||||
if(HAIKU)
|
||||
target_link_libraries(enet network)
|
||||
endif(HAIKU)
|
||||
|
||||
Vendored
+1
@@ -229,6 +229,7 @@ else()
|
||||
endif ()
|
||||
|
||||
add_library(fmt ${FMT_SOURCES} ${FMT_HEADERS} README.rst ChangeLog.rst)
|
||||
dolphin_disable_warnings_msvc(fmt)
|
||||
add_library(fmt::fmt ALIAS fmt)
|
||||
|
||||
if (FMT_WERROR)
|
||||
|
||||
Vendored
+1
@@ -73,6 +73,7 @@ endif()
|
||||
endif()
|
||||
|
||||
add_library(glslang STATIC ${SRCS})
|
||||
dolphin_disable_warnings_msvc(glslang)
|
||||
|
||||
target_include_directories(glslang
|
||||
PRIVATE
|
||||
|
||||
Vendored
+1
@@ -1,6 +1,7 @@
|
||||
project(hidapi)
|
||||
|
||||
add_library(hidapi STATIC hidapi/hidapi.h)
|
||||
dolphin_disable_warnings_msvc(hidapi)
|
||||
target_include_directories(hidapi PUBLIC hidapi)
|
||||
|
||||
if(APPLE)
|
||||
|
||||
Vendored
+1
@@ -12,6 +12,7 @@ set(SRCS
|
||||
)
|
||||
|
||||
add_library(imgui STATIC ${SRCS})
|
||||
dolphin_disable_warnings_msvc(imgui)
|
||||
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
target_link_libraries(imgui
|
||||
|
||||
+1
@@ -7,3 +7,4 @@ set(SRCS lib/iconv.c
|
||||
)
|
||||
|
||||
add_library(iconv STATIC ${SRCS})
|
||||
dolphin_disable_warnings_msvc(iconv)
|
||||
|
||||
Vendored
+1
@@ -207,6 +207,7 @@ set(LZMA_SRCS
|
||||
|
||||
add_library(lzma STATIC ${LZMA_SRCS} ${LZMA_PUBLIC_HDRS})
|
||||
add_library(LibLZMA::LibLZMA ALIAS lzma)
|
||||
dolphin_disable_warnings_msvc(lzma)
|
||||
|
||||
target_compile_definitions(lzma PUBLIC LZMA_API_STATIC)
|
||||
|
||||
|
||||
Vendored
+2
@@ -39,6 +39,8 @@ add_library(png STATIC
|
||||
pngwutil.c
|
||||
)
|
||||
|
||||
dolphin_disable_warnings_msvc(png)
|
||||
|
||||
option(PNG_HARDWARE_OPTIMIZATIONS "Enable hardware optimizations for libpng" OFF)
|
||||
|
||||
if(PNG_HARDWARE_OPTIMIZATIONS)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user