Skip to content

Commit

Permalink
FreeBSD patches.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivict committed Sep 9, 2022
1 parent cd58d39 commit 4116414
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions filament/backend/src/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#if defined(FILAMENT_DRIVER_SUPPORTS_VULKAN)
#include "vulkan/PlatformVkCocoa.h"
#endif
#elif defined(__linux__)
#elif defined(__linux__) || defined(__FreeBSD__)
#if defined(FILAMENT_SUPPORTS_WAYLAND)
#if defined (FILAMENT_DRIVER_SUPPORTS_VULKAN)
#include "vulkan/PlatformVkLinuxWayland.h"
Expand Down Expand Up @@ -119,7 +119,7 @@ DefaultPlatform* DefaultPlatform::create(Backend* backend) noexcept {
return new PlatformVkAndroid();
#elif defined(IOS)
return new PlatformVkCocoaTouch();
#elif defined(__linux__)
#elif defined(__linux__) || defined(__FreeBSD__)
#if defined(FILAMENT_SUPPORTS_WAYLAND)
return new PlatformVkLinuxWayland();
#elif defined(FILAMENT_SUPPORTS_X11)
Expand Down Expand Up @@ -154,7 +154,7 @@ DefaultPlatform* DefaultPlatform::create(Backend* backend) noexcept {
return new PlatformCocoaTouchGL();
#elif defined(__APPLE__)
return new PlatformCocoaGL();
#elif defined(__linux__)
#elif defined(__linux__) || defined(__FreeBSD__)
#if defined(FILAMENT_SUPPORTS_X11)
return new PlatformGLX();
#elif defined(FILAMENT_SUPPORTS_EGL_ON_LINUX)
Expand Down
2 changes: 1 addition & 1 deletion libs/bluevk/include/vulkan/vk_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define VK_USE_PLATFORM_ANDROID_KHR 1
#elif defined(IOS)
#define VK_USE_PLATFORM_IOS_MVK 1
#elif defined(__linux__)
#elif defined(__linux__) || defined(__FreeBSD__)
#if defined(FILAMENT_SUPPORTS_XCB)
#define VK_USE_PLATFORM_XCB_KHR 1
#endif
Expand Down
2 changes: 1 addition & 1 deletion libs/bluevk/src/BlueVKLinuxAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bool loadLibrary() {
path = FILAMENT_VKLIBRARY_PATH;
#elif defined(__ANDROID__)
path = "libvulkan.so";
#elif defined(__linux__)
#elif defined(__linux__) || defined(__FreeBSD__)
path = "libvulkan.so.1";
#else
#error "This file should only be compiled for Android or Linux"
Expand Down
6 changes: 4 additions & 2 deletions libs/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ if (ANDROID)
list(APPEND SRCS src/android/ThermalManager.cpp)
endif()
if (LINUX OR ANDROID)
list(APPEND SRCS src/linux/Condition.cpp)
list(APPEND SRCS src/linux/Mutex.cpp)
if (NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
list(APPEND SRCS src/linux/Condition.cpp)
list(APPEND SRCS src/linux/Mutex.cpp)
endif()
list(APPEND SRCS src/linux/Path.cpp)
endif()
if (APPLE)
Expand Down
2 changes: 1 addition & 1 deletion third_party/libsdl2/include/SDL_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "SDL_config_android.h"
#elif defined(__PSP__)
#include "SDL_config_psp.h"
#elif defined(__LINUX__)
#elif defined(__LINUX__) || defined(__FreeBSD__)
#if defined(FILAMENT_SUPPORTS_WAYLAND)
#include "SDL_config_linux_wayland.h"
#elif defined(FILAMENT_SUPPORTS_X11)
Expand Down

0 comments on commit 4116414

Please sign in to comment.