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

windows ci-workflows #7

Merged
merged 10 commits into from
Aug 12, 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
10 changes: 10 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ jobs:
run: cmake --workflow --preset="ci-clang-18-release"
- name: clang-18-libc++-release
run: cmake --workflow --preset="ci-clang-18-libc++-release"

build-and-test-msvc:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: ci-clangcl-release
run: cmake --workflow --preset="ci-clangcl-release"
- name: ci-msvc-release
run: cmake --workflow --preset="ci-msvc-release"

92 changes: 90 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,25 @@
"inherits": [ "cfg-common", "cfg-build-dir", "cfg-ninja", "cfg-c++23" ],
"cacheVariables": {"CMAKE_CXX_COMPILER": "g++-14" }
},
{
"name": "ci-windows-base",
"hidden": true,
"inherits": ["cfg-common", "cfg-c++23", "cfg-build-dir"],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "ci-clangcl-release",
"inherits": ["cfg-common", "cfg-build-dir"],
"inherits": ["ci-windows-base"],
"generator": "Visual Studio 17 2022",
"toolset": "ClangCL"
},
{
"name": "ci-msvc-release",
"inherits": ["cfg-common", "cfg-build-dir"],
"inherits": ["ci-windows-base"],
"generator": "Visual Studio 17 2022"
}
],
Expand All @@ -79,6 +89,26 @@
{
"name": "ci-gcc-14-release",
"configurePreset": "ci-gcc-14-release"
},
{
"name": "ci-clangcl-release",
"configurePreset": "ci-clangcl-release",
"configuration": "Release",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "ci-msvc-release",
"configurePreset": "ci-msvc-release",
"configuration": "Release",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
],
"testPresets": [
Expand All @@ -99,6 +129,30 @@
"configurePreset": "ci-gcc-14-release",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true}
},
{
"name": "ci-clangcl-release",
"configurePreset": "ci-clangcl-release",
"configuration": "Release",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "ci-msvc-release",
"configurePreset": "ci-msvc-release",
"configuration": "Release",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": true},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
],
"workflowPresets": [
Expand Down Expand Up @@ -152,6 +206,40 @@
"name": "ci-gcc-14-release"
}
]
},
{
"name": "ci-clangcl-release",
"steps": [
{
"type": "configure",
"name": "ci-clangcl-release"
},
{
"type": "build",
"name": "ci-clangcl-release"
},
{
"type": "test",
"name": "ci-clangcl-release"
}
]
},
{
"name": "ci-msvc-release",
"steps": [
{
"type": "configure",
"name": "ci-msvc-release"
},
{
"type": "build",
"name": "ci-msvc-release"
},
{
"type": "test",
"name": "ci-msvc-release"
}
]
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions cmake/CPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors

set(CPM_DOWNLOAD_VERSION 0.40.0)
set(CPM_HASH_SUM "7b354f3a5976c4626c876850c93944e52c83ec59a159ae5de5be7983f0e17a2a")
set(CPM_DOWNLOAD_VERSION 0.40.2)
set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d")

if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
Expand Down
8 changes: 6 additions & 2 deletions fixed_lib/include/fixedmath/core_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "numbers.h"
#include "detail/common.h"

#include "detail/static_call_operator_prolog.h"

namespace fixedmath::inline v2
{
//------------------------------------------------------------------------------------------------------
Expand All @@ -25,7 +27,7 @@ struct arithmetic_to_fixed_t
template<concepts::arithmetic_and_not_fixed arithmetic_type>
[[nodiscard, gnu::const, gnu::always_inline]]
///\returns fixed on success or NaN if source value is out of range
static constexpr auto operator()(arithmetic_type value) noexcept -> fixed_t
static_call_operator constexpr auto operator()(arithmetic_type value) static_call_operator_const noexcept -> fixed_t
{
if constexpr(std::is_integral_v<arithmetic_type>)
{
Expand Down Expand Up @@ -74,7 +76,8 @@ template<concepts::arithmetic_and_not_fixed arithmethic_type>
struct fixed_to_arithmetic_t
{
[[nodiscard, gnu::const, gnu::always_inline]]
static constexpr auto operator()(std::same_as<fixed_t> auto value) noexcept -> arithmethic_type
static_call_operator constexpr auto operator()(std::same_as<fixed_t> auto value
) static_call_operator_const noexcept -> arithmethic_type
{
if constexpr(typetraits::is_integral_v<arithmethic_type>)
{
Expand Down Expand Up @@ -105,3 +108,4 @@ constexpr fixed_t::operator arithmethic_type() const noexcept

} // namespace fixedmath::inline v2

#include "detail/static_call_operator_epilog.h"
1 change: 1 addition & 0 deletions fixed_lib/include/fixedmath/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "../types.h"
#include <fixedmath/detail/type_traits.h>
#include <bit>

namespace fixedmath::inline v2::detail
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef STATIC_CALL_OPERATOR_INCLUDED
#error "check inclusion of static_call_operator"
#endif
#undef STATIC_CALL_OPERATOR_INCLUDED

#pragma pop_macro("static_call_operator_const")
#pragma pop_macro("static_call_operator")

17 changes: 17 additions & 0 deletions fixed_lib/include/fixedmath/detail/static_call_operator_prolog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifdef STATIC_CALL_OPERATOR_INCLUDED
#error "Multiple inclusion of static_call_operator"
#endif
#define STATIC_CALL_OPERATOR_INCLUDED

#pragma push_macro("static_constexpr")
#pragma push_macro("static_call_operator")
#pragma push_macro("static_call_operator_const")

#if __cplusplus >= 202301L && defined(__cpp_static_call_operator)
#define static_call_operator static
#define static_call_operator_const
#else
#define static_call_operator
#define static_call_operator_const const
#endif

1 change: 0 additions & 1 deletion fixed_lib/include/fixedmath/detail/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <type_traits>
#include <limits>
#include <cmath>
#include "utility_cxx20.h"

namespace fixedmath::inline v2
{
Expand Down
41 changes: 0 additions & 41 deletions fixed_lib/include/fixedmath/detail/utility_cxx20.h

This file was deleted.

Loading
Loading