Handle openvr-specific warnings more precisely;

Instead of disabling a warning for the entire project, it is only
disabled while processing the OpenVR header.
This commit is contained in:
bjornbytes 2020-11-21 14:09:51 -07:00
parent 1b4a97035a
commit 842efe36c7
3 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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

View File

@ -16,7 +16,10 @@
#include <stdlib.h>
#include <stdint.h>
#undef EXTERN_C
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtypedef-redefinition"
#include <openvr_capi.h>
#pragma clang diagnostic pop
// From openvr_capi.h
extern intptr_t VR_InitInternal(EVRInitError *peError, EVRApplicationType eType);