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 83de570
Show file tree
Hide file tree
Showing 2 changed files with 12 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
18 changes: 11 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,19 @@

#include <iostream>

namespace {
std::string error_message = "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, error_message);
#else
static_assert(false, error_message);
#endif // __clang__
}

0 comments on commit 83de570

Please sign in to comment.