diff --git a/starboard/nplb/BUILD.gn b/starboard/nplb/BUILD.gn index 68c21ad89b99..33997e67e144 100644 --- a/starboard/nplb/BUILD.gn +++ b/starboard/nplb/BUILD.gn @@ -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" ] diff --git a/starboard/nplb/compiler_compliance/cpp_compiler_version_check.cc b/starboard/nplb/compiler_compliance/cpp_compiler_version_check.cc index 51ea6b039579..66c894780868 100644 --- a/starboard/nplb/compiler_compliance/cpp_compiler_version_check.cc +++ b/starboard/nplb/compiler_compliance/cpp_compiler_version_check.cc @@ -14,15 +14,20 @@ #include +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__ +}