mirror of
https://github.com/Vita3K/Vita3K.git
synced 2026-07-11 01:34:23 +02:00
cmake: Treat format-secutiry warnings as errors (#1667)
This commit is contained in:
committed by
GitHub
parent
58044ca42b
commit
e8151664b7
@@ -59,6 +59,12 @@ endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/W4 /we4774)
|
||||
else()
|
||||
add_compile_options(-Wformat -Werror=format-security)
|
||||
endif()
|
||||
|
||||
add_subdirectory(app)
|
||||
add_subdirectory(audio)
|
||||
add_subdirectory(config)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
add_library(
|
||||
audio
|
||||
STATIC
|
||||
include/audio/functions.h
|
||||
include/audio/state.h
|
||||
src/audio.cpp
|
||||
audio
|
||||
STATIC
|
||||
include/audio/functions.h
|
||||
include/audio/state.h
|
||||
src/audio.cpp
|
||||
)
|
||||
|
||||
target_include_directories(audio PUBLIC include)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
add_library(codec STATIC
|
||||
add_library(
|
||||
codec
|
||||
STATIC
|
||||
include/codec/state.h
|
||||
|
||||
src/atrac9.cpp
|
||||
src/decoder.cpp
|
||||
src/aac.cpp
|
||||
@@ -8,7 +9,8 @@ add_library(codec STATIC
|
||||
src/mjpeg.cpp
|
||||
src/mp3.cpp
|
||||
src/pcm.cpp
|
||||
src/player.cpp)
|
||||
src/player.cpp
|
||||
)
|
||||
|
||||
target_include_directories(codec PUBLIC include)
|
||||
target_link_libraries(codec PRIVATE ffmpeg libatrac9 util)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_library(
|
||||
dialog
|
||||
INTERFACE
|
||||
dialog
|
||||
INTERFACE
|
||||
)
|
||||
|
||||
target_include_directories(dialog INTERFACE include)
|
||||
|
||||
@@ -3,7 +3,6 @@ add_library(
|
||||
STATIC
|
||||
include/display/state.h
|
||||
include/display/functions.h
|
||||
|
||||
src/display.cpp
|
||||
)
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
add_library(
|
||||
gdbstub
|
||||
STATIC
|
||||
include/gdbstub/functions.h
|
||||
include/gdbstub/state.h
|
||||
src/gdb.cpp)
|
||||
gdbstub
|
||||
STATIC
|
||||
include/gdbstub/functions.h
|
||||
include/gdbstub/state.h
|
||||
src/gdb.cpp
|
||||
)
|
||||
|
||||
target_include_directories(gdbstub PUBLIC include)
|
||||
target_link_libraries(gdbstub PUBLIC cpu host)
|
||||
|
||||
@@ -24,7 +24,12 @@
|
||||
#include <np/state.h>
|
||||
|
||||
#include <imgui.h>
|
||||
// Disable warninig here is needed to compile on windows because we
|
||||
// are turning some warnings into errors to allow makepkg default flags
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4774)
|
||||
#include <imgui_memory_editor.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <gui/imgui_impl_sdl_state.h>
|
||||
|
||||
|
||||
@@ -19,7 +19,13 @@
|
||||
|
||||
#include <cpu/functions.h>
|
||||
|
||||
// Disable warninig here is needed to compile on windows because we
|
||||
// are turning some warnings into errors to allow makepkg default flags
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4774)
|
||||
#include <imgui_memory_editor.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <spdlog/fmt/fmt.h>
|
||||
|
||||
namespace gui {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
add_library(
|
||||
ime
|
||||
INTERFACE
|
||||
ime
|
||||
INTERFACE
|
||||
)
|
||||
|
||||
target_include_directories(ime INTERFACE include)
|
||||
|
||||
@@ -1196,7 +1196,12 @@ EXPORT(int, vscanf_s) {
|
||||
}
|
||||
|
||||
EXPORT(int, vsnprintf, char *s, size_t n, const char *format, va_list arg) {
|
||||
return snprintf(s, n, format, "");
|
||||
// Disable warninig here is needed to compile on windows because we
|
||||
// are turning some warnings into errors to allow makepkg default flags
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4774)
|
||||
return snprintf(s, n, format, arg);
|
||||
#pragma warning(pop)
|
||||
}
|
||||
|
||||
EXPORT(int, vsnprintf_s) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
add_library(
|
||||
net
|
||||
STATIC
|
||||
include/net/functions.h
|
||||
include/net/state.h
|
||||
include/net/types.h
|
||||
include/net/socket.h
|
||||
src/net.cpp
|
||||
src/posixsocket.cpp
|
||||
src/p2psocket.cpp
|
||||
net
|
||||
STATIC
|
||||
include/net/functions.h
|
||||
include/net/state.h
|
||||
include/net/types.h
|
||||
include/net/socket.h
|
||||
src/net.cpp
|
||||
src/posixsocket.cpp
|
||||
src/p2psocket.cpp
|
||||
)
|
||||
|
||||
target_include_directories(net PUBLIC include)
|
||||
|
||||
@@ -32,7 +32,8 @@ add_library(
|
||||
src/modules/passthrough.cpp
|
||||
src/ngs.cpp
|
||||
src/route.cpp
|
||||
src/scheduler.cpp)
|
||||
src/scheduler.cpp
|
||||
)
|
||||
|
||||
target_include_directories(ngs PUBLIC include)
|
||||
target_link_libraries(ngs PUBLIC codec)
|
||||
|
||||
@@ -6,7 +6,8 @@ add_library(np
|
||||
include/np/state.h
|
||||
src/trophy/context.cpp
|
||||
src/trophy/trp_parser.cpp
|
||||
src/init.cpp)
|
||||
src/init.cpp
|
||||
)
|
||||
|
||||
target_include_directories(np PUBLIC include)
|
||||
target_link_libraries(np PUBLIC yaml-cpp mem)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
add_library(
|
||||
rtc
|
||||
STATIC
|
||||
include/rtc/rtc.h
|
||||
src/rtc.cpp
|
||||
rtc
|
||||
STATIC
|
||||
include/rtc/rtc.h
|
||||
src/rtc.cpp
|
||||
)
|
||||
|
||||
target_include_directories(rtc PUBLIC include)
|
||||
|
||||
Reference in New Issue
Block a user