Skip to content

Commit

Permalink
IGL: Make platform defines aliases on internal builds
Browse files Browse the repository at this point in the history
Reviewed By: corporateshark, rameshviswanathan

Differential Revision: D67097515

fbshipit-source-id: dfbac5465df42b5ac6b1e04fe863ef900653c1e8
  • Loading branch information
Eric Griffith authored and facebook-github-bot committed Dec 13, 2024
1 parent 2d9e521 commit a6417fc
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions src/igl/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

#pragma once

// @fb-only
// @fb-only
// @fb-only

///--------------------------------------
/// MARK: - Platform

Expand All @@ -33,6 +37,22 @@
/// WEBGL:
/// IGL_PLATFORM_EMSCRIPTEN

#if !defined(IGL_CMAKE_BUILD)

// clang-format off
// @fb-only
// @fb-only
// @fb-only
// @fb-only
// @fb-only
// @fb-only
// @fb-only
// @fb-only
// @fb-only
// clang-format on

#else // !defined(IGL_CMAKE_BUILD)

// clang-format off
// Windows
#if defined(_WIN32)
Expand Down Expand Up @@ -88,11 +108,6 @@
#define IGL_PLATFORM_ANDROID 1
#define IGL_PLATFORM_LINUX 0
#define IGL_PLATFORM_EMSCRIPTEN 0

#if __ANDROID_MIN_SDK_VERSION__ >= 26
#define IGL_ANDROID_HWBUFFER_SUPPORTED
#endif // __ANDROID_MIN_SDK_VERSION__ >= 26

// Linux
#elif defined(__linux__)
#define IGL_PLATFORM_WINDOWS 0
Expand Down Expand Up @@ -129,6 +144,12 @@
#error "Platform not supported"
#endif

#endif // !defined(IGL_CMAKE_BUILD)

#if IGL_PLATFORM_ANDROID && __ANDROID_MIN_SDK_VERSION__ >= 26
#define IGL_ANDROID_HWBUFFER_SUPPORTED
#endif // __ANDROID_MIN_SDK_VERSION__ >= 26

// IGL_PLATFORM_XR is for extended reality platforms like OpenXR
#if !defined(IGL_PLATFORM_XR)
#define IGL_PLATFORM_XR 0
Expand Down Expand Up @@ -190,7 +211,7 @@
// IGL_PLATFORM_LINUX_SWIFTSHADER is a use case of IGL_PLATFORM_LINUX that uses
// SwiftShader for rendering. For example, Rainbow uses SwiftShader in a CPU only
// environment currently.
#if defined(FORCE_USE_SWIFTSHADER) && defined(IGL_PLATFORM_LINUX)
#if defined(FORCE_USE_SWIFTSHADER) && IGL_PLATFORM_LINUX
#define IGL_PLATFORM_LINUX_SWIFTSHADER 1
#else
#define IGL_PLATFORM_LINUX_SWIFTSHADER 0
Expand Down

0 comments on commit a6417fc

Please sign in to comment.