From 01f16e6d1fa840b8947d6fd07903a2ba635470d8 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 14 Feb 2021 13:15:22 +0100 Subject: [PATCH] cmake: Fix features being enabled on unsupported platforms --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a57ed2c..92ed829c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -505,9 +505,9 @@ function(is_feature_enabled FEATURE OUTPUT) endif() endfunction() -function(set_feature_disabled FEATURE DISABLED) +macro(set_feature_disabled FEATURE DISABLED) set(${PREFIX}DISABLE_${FEATURE} ${DISABLED} PARENT_SCOPE) -endfunction() +endmacro() # Features function(feature_encoder_ffmpeg RESOLVE) @@ -712,8 +712,9 @@ if(REQUIRE_JSON) endif() endif() +# NVIDIA Augmented Reality SDK (Windows) set(HAVE_NVIDIA_ARSDK OFF) -if(REQUIRE_NVIDIA_ARSDK) +if(REQUIRE_NVIDIA_ARSDK AND D_PLATFORM_WINDOWS) if(EXISTS "${PROJECT_SOURCE_DIR}/third-party/nvidia-arsdk/version.h") set(NVAR_ROOT "${PROJECT_SOURCE_DIR}/third-party/nvidia-arsdk") endif() @@ -723,8 +724,9 @@ if(REQUIRE_NVIDIA_ARSDK) set(HAVE_NVIDIA_ARSDK ${NVAR_FOUND}) endif() +# NVIDIA CUDA (Windows) set(HAVE_NVIDIA_CUDA OFF) -if(REQUIRE_NVIDIA_CUDA) +if(REQUIRE_NVIDIA_CUDA AND D_PLATFORM_WINDOWS) set(HAVE_NVIDIA_CUDA ON) endif()