mirror of https://github.com/PCSX2/pcsx2.git
Build: Silence warnings in third-party projects
This commit is contained in:
parent
02b64f4027
commit
e3a1125e84
|
@ -4,4 +4,4 @@ add_library(D3D12MemAlloc
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(D3D12MemAlloc PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
target_include_directories(D3D12MemAlloc PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
|
disable_compiler_warnings_for_target(D3D12MemAlloc)
|
||||||
|
|
|
@ -14,3 +14,4 @@ target_include_directories(demangler PUBLIC ${PROJECT_SOURCE_DIR}/include/)
|
||||||
|
|
||||||
set_property(TARGET demangler PROPERTY CXX_STANDARD 17)
|
set_property(TARGET demangler PROPERTY CXX_STANDARD 17)
|
||||||
set_property(TARGET demangler PROPERTY CXX_STANDARD_REQUIRED ON)
|
set_property(TARGET demangler PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||||
|
disable_compiler_warnings_for_target(demangler)
|
||||||
|
|
|
@ -9,4 +9,5 @@ add_library(jpgd
|
||||||
target_include_directories(jpgd PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
target_include_directories(jpgd PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
set_property(TARGET jpgd PROPERTY CXX_STANDARD 17)
|
set_property(TARGET jpgd PROPERTY CXX_STANDARD 17)
|
||||||
set_property(TARGET jpgd PROPERTY CXX_STANDARD_REQUIRED ON)
|
set_property(TARGET jpgd PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||||
|
disable_compiler_warnings_for_target(jpgd)
|
||||||
|
|
||||||
|
|
|
@ -19,3 +19,4 @@ add_library(png
|
||||||
target_link_libraries(png PRIVATE ZLIB::ZLIB)
|
target_link_libraries(png PRIVATE ZLIB::ZLIB)
|
||||||
target_include_directories(png PUBLIC .)
|
target_include_directories(png PUBLIC .)
|
||||||
add_library(PNG::PNG ALIAS png)
|
add_library(PNG::PNG ALIAS png)
|
||||||
|
disable_compiler_warnings_for_target(png)
|
||||||
|
|
|
@ -156,3 +156,5 @@ target_include_directories(xz-lzma
|
||||||
xz/src/liblzma/simple
|
xz/src/liblzma/simple
|
||||||
)
|
)
|
||||||
add_library(LibLZMA::LibLZMA ALIAS xz-lzma)
|
add_library(LibLZMA::LibLZMA ALIAS xz-lzma)
|
||||||
|
|
||||||
|
disable_compiler_warnings_for_target(xz-lzma)
|
||||||
|
|
|
@ -29,3 +29,5 @@ add_library(pcsx2-zlib
|
||||||
target_include_directories(pcsx2-zlib PUBLIC .)
|
target_include_directories(pcsx2-zlib PUBLIC .)
|
||||||
|
|
||||||
add_library(ZLIB::ZLIB ALIAS pcsx2-zlib)
|
add_library(ZLIB::ZLIB ALIAS pcsx2-zlib)
|
||||||
|
|
||||||
|
disable_compiler_warnings_for_target(pcsx2-zlib)
|
||||||
|
|
|
@ -256,3 +256,11 @@ function(fixup_file_properties target)
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
function(disable_compiler_warnings_for_target target)
|
||||||
|
if(MSVC)
|
||||||
|
target_compile_options(${target} PRIVATE "/W0")
|
||||||
|
else()
|
||||||
|
target_compile_options(${target} PRIVATE "-w")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
|
@ -177,6 +177,7 @@ add_subdirectory(3rdparty/jpgd EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/simpleini EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/simpleini EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/imgui EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/imgui EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/cpuinfo EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/cpuinfo EXCLUDE_FROM_ALL)
|
||||||
|
disable_compiler_warnings_for_target(cpuinfo)
|
||||||
add_subdirectory(3rdparty/zydis EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/zydis EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/zstd EXCLUDE_FROM_ALL)
|
||||||
add_subdirectory(3rdparty/libzip EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/libzip EXCLUDE_FROM_ALL)
|
||||||
|
@ -192,7 +193,12 @@ endif()
|
||||||
|
|
||||||
if(CUBEB_API)
|
if(CUBEB_API)
|
||||||
add_subdirectory(3rdparty/cubeb EXCLUDE_FROM_ALL)
|
add_subdirectory(3rdparty/cubeb EXCLUDE_FROM_ALL)
|
||||||
target_compile_options(cubeb PRIVATE "-w")
|
disable_compiler_warnings_for_target(cubeb)
|
||||||
target_compile_options(speex PRIVATE "-w")
|
disable_compiler_warnings_for_target(speex)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Deliberately at the end. We don't want to set the flag on third-party projects.
|
||||||
|
if(MSVC)
|
||||||
|
# Don't warn about "deprecated" POSIX functions.
|
||||||
|
add_definitions("-D_CRT_SECURE_NO_WARNINGS" "-DCRT_SECURE_NO_DEPRECATE")
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue