Skip to content

Commit

Permalink
[aurora-au] Update to version 0.4.0 and add test port (microsoft#42679)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon <v-zhli17@microsoft.com>
  • Loading branch information
JonLiu1993 and Jon authored Dec 23, 2024
1 parent 119d4ff commit a08d0b1
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 49 deletions.
41 changes: 0 additions & 41 deletions ports/aurora-au/disable-googletest.patch

This file was deleted.

27 changes: 27 additions & 0 deletions ports/aurora-au/fix-usage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/au/code/au/CMakeLists.txt b/au/code/au/CMakeLists.txt
index edb965c..7c518bf 100644
--- a/au/code/au/CMakeLists.txt
+++ b/au/code/au/CMakeLists.txt
@@ -39,6 +39,7 @@ header_only_library(
quantity.hh
quantity_point.hh
rep.hh
+ static_cast_checkers.hh
unit_of_measure.hh
unit_symbol.hh
wrapper_operations.hh
@@ -465,6 +466,14 @@ gtest_based_test(
au
)

+gtest_based_test(
+ NAME static_cast_checkers_test
+ SRCS
+ static_cast_checkers_test.cc
+ DEPS
+ au
+)
+
gtest_based_test(
NAME stdx_test
SRCS
13 changes: 9 additions & 4 deletions ports/aurora-au/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO aurora-opensource/au
REF "${VERSION}"
SHA512 4aa3282f6b76fbadd04ca572734f72c86b1b0b4e85fc21a03d1ab00b83d3aea319ab2dac3934361b5f6fa7c4a0dccece94fe0a57f3d73d208315b51b1950e374
SHA512 7e78ac2502037ad87d3171c366c8c91b030678af26d6db75cf12384faa077e40b159b570ddd774b76bc7ca34d74d1898958b6d6b33d56a8eb5ca1f96c1a9ed66
HEAD_REF main
PATCHES
disable-googletest.patch
PATCHES
fix-usage.patch
)

vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DAU_EXCLUDE_GTEST_DEPENDENCY=1
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(
Expand Down
3 changes: 1 addition & 2 deletions ports/aurora-au/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "aurora-au",
"version-semver": "0.3.5",
"port-version": 1,
"version-semver": "0.4.0",
"description": "A C++14-compatible physical units library with no dependencies and a single-file delivery option. Emphasis on safety, accessibility, performance, and developer experience.",
"homepage": "https://github.com/aurora-opensource/au",
"documentation": "https://aurora-opensource.github.io/au/main/",
Expand Down
1 change: 1 addition & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,7 @@ vcpkg-ci-arrow:x64-windows-static=pass
vcpkg-ci-arrow:x64-windows-static-md=pass
vcpkg-ci-arrow:x64-osx=pass
vcpkg-ci-arrow:x64-linux=pass
vcpkg-ci-aurora-au:x64-linux=pass
vcpkg-ci-boost:arm-neon-android=pass
vcpkg-ci-boost:arm64-android=pass
vcpkg-ci-boost:arm64-uwp=pass
Expand Down
7 changes: 7 additions & 0 deletions scripts/test_ports/vcpkg-ci-aurora-au/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

vcpkg_find_acquire_program(PKGCONFIG)

vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}/project")

vcpkg_cmake_build()
9 changes: 9 additions & 0 deletions scripts/test_ports/vcpkg-ci-aurora-au/project/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.29)

project(vcpkg-ci-aurora-au LANGUAGES CXX)

find_package(Au CONFIG REQUIRED)

add_executable(test_au_client test_au_client.cc)
target_link_libraries(test_au_client PRIVATE Au::au)
target_compile_features(test_au_client PRIVATE cxx_std_14)
18 changes: 18 additions & 0 deletions scripts/test_ports/vcpkg-ci-aurora-au/project/test_au_client.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>

#include "au/au.hh"
#include "au/io.hh"
#include "au/units/hours.hh"
#include "au/units/meters.hh"
#include "au/units/miles.hh"

using ::au::symbols::h;
using ::au::symbols::mi;
constexpr auto km = ::au::kilo(::au::symbols::m);

int main(int argc, char **argv) {
constexpr auto v = 65.0 * mi / h;
std::cout << v << ", in km/h, rounded to nearest integer, is "
<< round_as(km / h, v) << std::endl;
return 0;
}
13 changes: 13 additions & 0 deletions scripts/test_ports/vcpkg-ci-aurora-au/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "vcpkg-ci-aurora-au",
"version-string": "ci",
"description": "Testing packages which provide AURORA-AU",
"license": null,
"dependencies": [
"aurora-au",
{
"name": "vcpkg-cmake",
"host": true
}
]
}
5 changes: 5 additions & 0 deletions versions/a-/aurora-au.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "291af3f0c1c91f4c93c000063b601e8a2f0636bd",
"version-semver": "0.4.0",
"port-version": 0
},
{
"git-tree": "843b8ff14fe6b933b9888e9badec1595bdcec3bf",
"version-semver": "0.3.5",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@
"port-version": 2
},
"aurora-au": {
"baseline": "0.3.5",
"port-version": 1
"baseline": "0.4.0",
"port-version": 0
},
"autobahn": {
"baseline": "20.8.1",
Expand Down

0 comments on commit a08d0b1

Please sign in to comment.