diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index a0539d2a04..7205efa398 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -13,12 +13,17 @@ list(REMOVE_ITEM PLUGIN_SUBDIRS "CMakeFiles") # client-side plugins if (NOT SERVER_ONLY AND NOT ANDROID) if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - set(DIR "oculus") - add_subdirectory(${DIR}) - set(DIR "openvr") - add_subdirectory(${DIR}) - set(DIR "oculusLegacy") - add_subdirectory(${DIR}) + if (NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") AND (MSVC_VERSION LESS 1930))) + # Check if we're building on MSVC 2022. If so, Oculus plugin fails to build. + set(DIR "oculus") + add_subdirectory(${DIR}) + set(DIR "openvr") + add_subdirectory(${DIR}) + set(DIR "oculusLegacy") + add_subdirectory(${DIR}) + else() + message(WARNING "Building under ${CMAKE_CXX_COMPILER_ID}, MSVC Version ${MSVC_VERSION}. Oculus plugin unsupported, disabling.") + endif() endif() set(DIR "hifiSdl2")