From 842efe36c7b85ec29c6d1e2522922e3de0e7234c Mon Sep 17 00:00:00 2001 From: bjornbytes Date: Sat, 21 Nov 2020 14:09:51 -0700 Subject: [PATCH] Handle openvr-specific warnings more precisely; Instead of disabling a warning for the entire project, it is only disabled while processing the OpenVR header. --- CMakeLists.txt | 3 --- Tuprules.tup | 1 - src/modules/headset/headset_openvr.c | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 409876f2..e7661b03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,9 +449,6 @@ if(LOVR_ENABLE_HEADSET) if(LOVR_USE_OPENVR) add_definitions(-DLOVR_USE_OPENVR) target_sources(lovr PRIVATE src/modules/headset/headset_openvr.c) - if(UNIX) - target_compile_options(lovr PRIVATE -Wno-typedef-redefinition) - endif() endif() if(LOVR_USE_OPENXR) add_definitions(-DLOVR_USE_OPENXR) diff --git a/Tuprules.tup b/Tuprules.tup index fb51b8da..58ef6114 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -9,7 +9,6 @@ CFLAGS += -I$(ROOT)/src/modules CFLAGS += -fvisibility=hidden CFLAGS += -Wall -Wextra CFLAGS += -Wno-unused-parameter -CFLAGS_@(OPENVR) += -Wno-typedef-redefinition CFLAGS_@(STRICT) += -Werror FLAGS_@(DEBUG) += -g FLAGS_@(OPTIMIZE) += -Oz diff --git a/src/modules/headset/headset_openvr.c b/src/modules/headset/headset_openvr.c index b5d95714..5d2e86e7 100644 --- a/src/modules/headset/headset_openvr.c +++ b/src/modules/headset/headset_openvr.c @@ -16,7 +16,10 @@ #include #include #undef EXTERN_C +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wtypedef-redefinition" #include +#pragma clang diagnostic pop // From openvr_capi.h extern intptr_t VR_InitInternal(EVRInitError *peError, EVRApplicationType eType);