Skip to content

Commit

Permalink
Add nplb compiler check for all linux based platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
niranjanyardi committed Sep 12, 2024
1 parent 727a2b7 commit 7adc4d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion starboard/nplb/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ target(gtest_target_type, "nplb") {
"window_get_size_test.cc",
]

if (!is_android) {
if (is_linux) {
# Android has a different clang version than linux.
sources +=
[ "//starboard/nplb/compiler_compliance/cpp_compiler_version_check.cc" ]
Expand Down
17 changes: 10 additions & 7 deletions starboard/nplb/compiler_compliance/cpp_compiler_version_check.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@

#include <iostream>

#define COBALT_CLANG_ERROR_MSG "We compile above Starboard targets like Cobalt, Nplb with " \
"clang17 or higher. If you are building with a non-Cobalt " \
"provided toolchain you may run into this error. To fix this error" \
"build libnplb using the Evergreen toolchain : " \
"cobalt.dev/development/setup-raspi"

#ifdef __clang__
// Check Clang major version required for building Nplb tests.
// Clang major version can be deduced from "clang_revision" in
// starboard/build/config/clang.gni
static_assert(
__clang_major__ >= 17,
"We compile above Starboard targets like Cobalt, Nplb with "
"clang17 or higher. If you are building with a non-Cobalt "
"provided toolchain you may run into this error. To fix this error"
"build libnplb using the Evergreen toolchain : "
"cobalt.dev/development/setup-raspi");
static_assert(__clang_major__ >= 17, COBALT_CLANG_ERROR_MSG);
#else
static_assert(false, COBALT_CLANG_ERROR_MSG);
#endif // __clang__
#undef COBALT_CLANG_ERROR_MSG

0 comments on commit 7adc4d0

Please sign in to comment.