From 2b3fcaaf0bfc122b12d2eb6cca222d55ceddb652 Mon Sep 17 00:00:00 2001 From: Stephen Gregoratto Date: Sat, 2 Sep 2023 23:16:02 +1000 Subject: [PATCH] Include 3rd-party libs as system headers Now, the compiler will only report errors in our code and not in any of these headers. --- CMakeLists.txt | 17 ++++++----------- src/platform_sokol.c | 6 +++--- src/render_gl.c | 2 +- src/wipeout/image.c | 2 +- src/wipeout/intro.c | 2 +- src/wipeout/sfx.c | 2 +- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a08fc63..c29e2f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,7 @@ if(RENDERER IN_LIST gl_renderers) set(using_gl true) endif() -# Supported on Linux, FreeBSD, NetBSD? -cmake_dependent_option(USE_GLVND "Link against modern GLVND ABIs" ON "using_gl;UNIX;NOT APPLE;NOT EMSCRIPTEN" OFF) +cmake_dependent_option(USE_GLVND "Link against modern GLVND ABIs" OFF "using_gl;LINUX" ON) cmake_dependent_option(MINIMAL_BUNDLE "Do not include music/movies for web builds" OFF "EMSCRIPTEN" OFF) find_package(OpenGL) @@ -95,18 +94,14 @@ set(common_src packaging/windows/wipeout.rc ) -set(compile_opts - $<$:/W4> - $<$>:-Wall -Wextra -Wstrict-prototypes> -) -set_source_files_properties("${common_src}" - PROPERTIES COMPILE_FLAGS "${compile_opts}" -) - add_executable(wipeout WIN32 ${common_src}) set_property(TARGET wipeout PROPERTY C_STANDARD 11) target_include_directories(wipeout PRIVATE src) -target_compile_options(wipeout PRIVATE ${compile_opts}) +target_include_directories(wipeout SYSTEM PRIVATE src/libs) +target_compile_options(wipeout PRIVATE + $<$:/W4> + $<$>:-Wall -Wextra> +) if(WIN32) target_compile_definitions(wipeout PRIVATE diff --git a/src/platform_sokol.c b/src/platform_sokol.c index d6faf69..00993e6 100644 --- a/src/platform_sokol.c +++ b/src/platform_sokol.c @@ -14,9 +14,9 @@ #endif #define SOKOL_IMPL -#include "libs/sokol_audio.h" -#include "libs/sokol_time.h" -#include "libs/sokol_app.h" +#include +#include +#include #include "input.h" // FIXME: we should figure out the actual path where the executabe resides, diff --git a/src/render_gl.c b/src/render_gl.c index 3a3642c..17d7636 100644 --- a/src/render_gl.c +++ b/src/render_gl.c @@ -23,7 +23,7 @@ -#include "libs/stb_image_write.h" +#include #include "system.h" #include "render.h" diff --git a/src/wipeout/image.c b/src/wipeout/image.c index dc141ac..9f5fc7f 100755 --- a/src/wipeout/image.c +++ b/src/wipeout/image.c @@ -17,7 +17,7 @@ #define STB_IMAGE_WRITE_IMPLEMENTATION -#include "../libs/stb_image_write.h" +#include #define TIM_TYPE_PALETTED_4_BPP 0x08 diff --git a/src/wipeout/intro.c b/src/wipeout/intro.c index c6ed2db..38e66d2 100644 --- a/src/wipeout/intro.c +++ b/src/wipeout/intro.c @@ -19,7 +19,7 @@ void *realloc_dummmy(void *p, size_t sz) { #define PLM_MALLOC mem_bump #define PLM_FREE free_dummmy #define PLM_REALLOC realloc_dummmy -#include "../libs/pl_mpeg.h" +#include #define INTRO_AUDIO_BUFFER_LEN (64 * 1024) diff --git a/src/wipeout/sfx.c b/src/wipeout/sfx.c index 8c3deea..178566b 100644 --- a/src/wipeout/sfx.c +++ b/src/wipeout/sfx.c @@ -7,7 +7,7 @@ #define QOA_IMPLEMENTATION #define QOA_NO_STDIO -#include "../libs/qoa.h" +#include typedef struct { int16_t *samples;