Skip to content

Commit 8d3640b

Browse files
psruthikNVben-clayton
authored andcommitted
amber: Add support for QNX.
This change adds support for enabling amber to be built for QNX platforms. 1. Update CMakeLists.txt to not link with pthread on QNX platforms as pthread is implemented as part of libc on QNX and a separate pthread library does not exist on QNX. 2. Update src/platform.h to recognize __QNX__ as a supported platform
1 parent 5f29e58 commit 8d3640b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ if (${AMBER_ENABLE_SHADERC})
112112
target_link_libraries(libamber shaderc SPIRV)
113113
endif()
114114

115-
if (NOT MSVC AND NOT ANDROID)
115+
if (NOT MSVC AND NOT ANDROID AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
116116
target_link_libraries(libamber pthread)
117117
endif()
118118

src/platform.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ namespace amber {
3030
#define AMBER_PLATFORM_POSIX 1
3131
#elif defined(__Fuchsia__)
3232
#define AMBER_PLATFORM_POSIX 1
33+
#elif defined(__QNX__)
34+
#define AMBER_PLATFORM_QNX 1
35+
#define AMBER_PLATFORM_POSIX 1
3336
#else
3437
#error "Unknown platform."
3538
#endif
@@ -54,6 +57,10 @@ namespace amber {
5457
#define AMBER_PLATFORM_POSIX 0
5558
#endif
5659

60+
#if !defined(AMBER_PLATFORM_QNX)
61+
#define AMBER_PLATFORM_QNX 0
62+
#endif
63+
5764
} // namespace amber
5865

5966
#endif // SRC_PLATFORM_H_

0 commit comments

Comments
 (0)