mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
Suppress warnings for all third-party libraries
This commit is contained in:
1 parent
07ad4cf2e0
commit
12fec3026b
8 files changed
+32
-27
No files matched your search
@@ -178,3 +178,13 @@ function (check_linker_flag _flag _out_var)
|
||||
SET(CMAKE_REQUIRED_FLAGS "${_flag}")
|
||||
CHECK_C_COMPILER_FLAG("" ${_out_var})
|
||||
endfunction(check_linker_flag)
|
||||
|
||||
# Suppresses warnings for the specified target
|
||||
function(suppress_warnings _target)
|
||||
if (MSVC)
|
||||
target_compile_options(${_target} PRIVATE "/W0")
|
||||
else()
|
||||
# Assume everything else uses GCC style options
|
||||
target_compile_options(${_target} PRIVATE "-w")
|
||||
endif()
|
||||
endfunction(suppress_warnings)
|
||||
@@ -306,11 +306,9 @@ IF(FSO_BUILD_INCLUDED_LIBS OR NOT JANSSON_FOUND)
|
||||
${JANSSON_SRC}
|
||||
${JANSSON_HDR_PRIVATE}
|
||||
${JANSSON_HDR_PUBLIC})
|
||||
|
||||
if (MSVC)
|
||||
# Disable warnings if building from source
|
||||
target_compile_options(jansson PRIVATE "/W0")
|
||||
endif()
|
||||
|
||||
# Disable warnings if building from source
|
||||
suppress_warnings(jansson)
|
||||
|
||||
set_target_properties(jansson PROPERTIES FOLDER "3rdparty")
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ IF (FSO_BUILD_INCLUDED_LIBS OR NOT JPEG_FOUND)
|
||||
PROPERTIES
|
||||
FOLDER "3rdparty"
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(jpeg PRIVATE "/W0")
|
||||
endif()
|
||||
|
||||
|
||||
# Disable warnings if building from source
|
||||
suppress_warnings(jpeg)
|
||||
|
||||
target_link_libraries(jpeg PUBLIC compiler)
|
||||
|
||||
SET(JPEG_LIBS jpeg CACHE INTERNAL "JPEG library")
|
||||
|
||||
@@ -50,11 +50,9 @@ IF (FSO_BUILD_INCLUDED_LIBS OR NOT PNG_FOUND)
|
||||
PROPERTIES
|
||||
FOLDER "3rdparty"
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
# Disable warnings if building from source
|
||||
target_compile_options(png PRIVATE "/W0")
|
||||
endif()
|
||||
|
||||
# Disable warnings if building from source
|
||||
suppress_warnings(png)
|
||||
|
||||
target_link_libraries(png PUBLIC ${ZLIB_LIBS})
|
||||
target_link_libraries(png PUBLIC compiler)
|
||||
|
||||
@@ -207,6 +207,8 @@ ELSE(FSO_USE_LUAJIT)
|
||||
if (MSVC)
|
||||
# Disable warnings if building from source
|
||||
target_compile_options(lua51 PRIVATE "/W0")
|
||||
else()
|
||||
target_compile_options(lua51 PRIVATE "-w")
|
||||
endif()
|
||||
target_link_libraries(lua51 PUBLIC compiler)
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ ADD_LIBRARY(md5 STATIC ${MD5_SOURCES})
|
||||
|
||||
target_include_directories(md5 PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
if (MSVC)
|
||||
target_compile_options(md5 PRIVATE "/W0")
|
||||
endif()
|
||||
# Disable warnings if building from source
|
||||
suppress_warnings(md5)
|
||||
|
||||
set_target_properties(md5 PROPERTIES FOLDER "3rdparty")
|
||||
target_link_libraries(md5 PUBLIC compiler)
|
||||
@@ -22,11 +22,8 @@ set_target_properties(mongoose
|
||||
)
|
||||
|
||||
# Disable warnings if building from source
|
||||
if (MSVC)
|
||||
target_compile_options(mongoose PRIVATE "/W0")
|
||||
else()
|
||||
target_compile_options(mongoose PRIVATE "-w")
|
||||
endif()
|
||||
suppress_warnings(mongoose)
|
||||
|
||||
target_link_libraries(mongoose PUBLIC compiler)
|
||||
|
||||
SET(MONGOOSE_LIBS mongoose CACHE INTERNAL "mongoose library")
|
||||
@@ -38,11 +38,10 @@ IF (FSO_BUILD_INCLUDED_LIBS OR NOT ZLIB_FOUND)
|
||||
FOLDER "3rdparty"
|
||||
DEFINE_SYMBOL ZLIB_DLL # This will only be defined if we are building a shared library
|
||||
)
|
||||
|
||||
if (MSVC)
|
||||
# Disable warnings if building from source
|
||||
target_compile_options(zlib PRIVATE "/W0")
|
||||
endif()
|
||||
|
||||
# Disable warnings if building from source
|
||||
suppress_warnings(zlib)
|
||||
|
||||
target_link_libraries(zlib PUBLIC compiler)
|
||||
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
|
||||
Reference in new issue
Block a user