Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[benchmark] Fix build failure under QNX #35644

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions ports/benchmark/fix_qnx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/src/sysinfo.cc b/src/sysinfo.cc
index 922e83a..ec9fd35 100644
--- a/src/sysinfo.cc
+++ b/src/sysinfo.cc
@@ -771,8 +771,8 @@ double GetCPUCyclesPerSecond(CPUInfo::Scaling scaling) {
kstat_close(kc);
return clock_hz;
#elif defined(BENCHMARK_OS_QNX)
- return static_cast<double>((int64_t)(SYSPAGE_ENTRY(cpuinfo)->speed) *
- (int64_t)(1000 * 1000));
+ return static_cast<double>(static_cast<int64_t>(SYSPAGE_ENTRY(cpuinfo)->speed) *
+ static_cast<int64_t>(1000 * 1000));
#elif defined(BENCHMARK_OS_QURT)
// QuRT doesn't provide any API to query Hexagon frequency.
return 1000000000;
3 changes: 3 additions & 0 deletions ports/benchmark/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ vcpkg_from_github(
REF "v${VERSION}"
SHA512 4e12114251c79a426873cfba6e27270b69fc980cef9a68e9cb3170f8e2e203f77dee19ab1e65cad51cd67e60991d3bbfdd52553f22522ce5e6c611b5aa07602c
HEAD_REF main
PATCHES
fix_qnx.patch
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
-DBENCHMARK_ENABLE_TESTING=OFF
-Werror=old-style-cast
)

vcpkg_cmake_install()
Expand Down
1 change: 1 addition & 0 deletions ports/benchmark/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$comment": "https://github.com/google/benchmark/issues/661 describes the missing UWP support upstream",
"name": "benchmark",
"version-semver": "1.8.3",
"port-version": 1,
"description": "A library to support the benchmarking of functions, similar to unit-tests.",
"homepage": "https://github.com/google/benchmark",
"license": "Apache-2.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/benchmark.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5e8efca95a7d5d9c74f8a2c5c2ee05bbd2271451",
"version-semver": "1.8.3",
"port-version": 1
},
{
"git-tree": "fc61bd374495cb30bb9c58c6e9d0d4568898f0c8",
"version-semver": "1.8.3",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
},
"benchmark": {
"baseline": "1.8.3",
"port-version": 0
"port-version": 1
},
"bento4": {
"baseline": "1.6.0-640",
Expand Down
Loading