diff --git a/third_party/chre/BUILD.bazel b/third_party/chre/BUILD.bazel index 26b708c212..e74b91a526 100644 --- a/third_party/chre/BUILD.bazel +++ b/third_party/chre/BUILD.bazel @@ -20,5 +20,6 @@ filegroup( name = "chre", srcs = [ "integration_test.cc", + "version.cc", ], ) diff --git a/third_party/chre/BUILD.gn b/third_party/chre/BUILD.gn index efb2889d5c..6f5c78e34c 100644 --- a/third_party/chre/BUILD.gn +++ b/third_party/chre/BUILD.gn @@ -104,7 +104,6 @@ if (dir_pw_third_party_chre == "") { "$dir_pw_third_party_chre/platform/shared/nanoapp/nanoapp_dso_util.cc", "$dir_pw_third_party_chre/platform/shared/pal_system_api.cc", "$dir_pw_third_party_chre/platform/shared/system_time.cc", - "$dir_pw_third_party_chre/platform/shared/version.cc", "$dir_pw_third_party_chre/util/buffer_base.cc", "$dir_pw_third_party_chre/util/dynamic_vector_base.cc", "$dir_pw_third_party_chre/util/nanoapp/audio.cc", @@ -114,6 +113,13 @@ if (dir_pw_third_party_chre == "") { "$dir_pw_third_party_chre/util/system/debug_dump.cc", ] + # TODO(b/300633363): Use CHRE's version when it compiles on MacOS. + if (current_os == "mac") { + sources += [ "version.cc" ] + } else { + sources += [ "$dir_pw_third_party_chre/platform/shared/version.cc" ] + } + public_deps = [ ":chre_headers", "$pw_chre_PLATFORM_BACKEND", diff --git a/third_party/chre/version.cc b/third_party/chre/version.cc new file mode 100644 index 0000000000..792eede4ea --- /dev/null +++ b/third_party/chre/version.cc @@ -0,0 +1,26 @@ +// Copyright 2023 The Pigweed Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +#include "chre/platform/version.h" + +#ifndef CHRE_VERSION_STRING +#define CHRE_VERSION_STRING "undefined" +#endif // CHRE_VERSION_STRING + +namespace chre { + +// TODO(b/300633363): Use CHRE's version when it compiles on MacOS. +const char* getChreVersionString() { return CHRE_VERSION_STRING; } + +} // namespace chre