summaryrefslogtreecommitdiff
path: root/platform/macos
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2022-10-25 22:20:54 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2022-10-26 08:55:05 +0300
commit4dd8f68120bc3d3be94e0556ccfef9ee4bf8311a (patch)
tree8d0dd1b58dedbdae7a84d1f36317e411ebabcdf2 /platform/macos
parent2b505b74b9b0a7005586ecaa9aa1236e86b18437 (diff)
Fix build with Vulkan disabled and no Vulkan headers installed.
Diffstat (limited to 'platform/macos')
-rw-r--r--platform/macos/detect.py4
-rw-r--r--platform/macos/vulkan_context_macos.h4
-rw-r--r--platform/macos/vulkan_context_macos.mm3
3 files changed, 10 insertions, 1 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py
index 511286d52b..e73c5322ea 100644
--- a/platform/macos/detect.py
+++ b/platform/macos/detect.py
@@ -223,6 +223,8 @@ def configure(env: "Environment"):
"AVFoundation",
"-framework",
"CoreMedia",
+ "-framework",
+ "QuartzCore",
]
)
env.Append(LIBS=["pthread", "z"])
@@ -236,7 +238,7 @@ def configure(env: "Environment"):
if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
- env.Append(LINKFLAGS=["-framework", "Metal", "-framework", "QuartzCore", "-framework", "IOSurface"])
+ env.Append(LINKFLAGS=["-framework", "Metal", "-framework", "IOSurface"])
if not env["use_volk"]:
env.Append(LINKFLAGS=["-lMoltenVK"])
mvk_found = False
diff --git a/platform/macos/vulkan_context_macos.h b/platform/macos/vulkan_context_macos.h
index 579c42b042..2a81336994 100644
--- a/platform/macos/vulkan_context_macos.h
+++ b/platform/macos/vulkan_context_macos.h
@@ -31,6 +31,8 @@
#ifndef VULKAN_CONTEXT_MACOS_H
#define VULKAN_CONTEXT_MACOS_H
+#ifdef VULKAN_ENABLED
+
#include "drivers/vulkan/vulkan_context.h"
#import <AppKit/AppKit.h>
@@ -44,4 +46,6 @@ public:
~VulkanContextMacOS();
};
+#endif // VULKAN_ENABLED
+
#endif // VULKAN_CONTEXT_MACOS_H
diff --git a/platform/macos/vulkan_context_macos.mm b/platform/macos/vulkan_context_macos.mm
index cf317f3c68..1df6b3ed18 100644
--- a/platform/macos/vulkan_context_macos.mm
+++ b/platform/macos/vulkan_context_macos.mm
@@ -28,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#ifdef VULKAN_ENABLED
#include "vulkan_context_macos.h"
#ifdef USE_VOLK
#include <volk.h>
@@ -57,3 +58,5 @@ VulkanContextMacOS::VulkanContextMacOS() {
VulkanContextMacOS::~VulkanContextMacOS() {
}
+
+#endif // VULKAN_ENABLED