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 303a9de
Show file tree
Hide file tree
Showing 2 changed files with 13 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
19 changes: 12 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,20 @@

#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 303a9de

Please sign in to comment.