Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
9 changes: 9 additions & 0 deletions .github/workflows/osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Add specification clang++ in the conda environment specification
run: |
echo " - clangxx==17.0.6" >> environment-dev.yml

- name: Set conda environment
uses: mamba-org/setup-micromamba@main
with:
Expand All @@ -36,6 +40,11 @@ jobs:
init-shell: bash
cache-downloads: true

- name: Set environment variable to use clang++
run: |
echo "CXX=$CONDA_PREFIX/bin/clang++" >> $GITHUB_ENV
echo "CMAKE_CXX_COMPILER=$CONDA_PREFIX/bin/clang++" >> $GITHUB_ENV

- name: Configure using CMake
run: cmake -Bbuild -DCMAKE_BUILD_TYPE:STRING=${{matrix.config.name}} -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DBUILD_TESTS=ON

Expand Down
8 changes: 4 additions & 4 deletions include/sparrow/algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace sparrow
{
#if COMPILING_WITH_APPLE_CLANG
#if COMPILING_WITH_APPLE_CLANG || USING_LIBCPP_PRE_17

template <typename T>
concept OrdCategory = std::same_as<T, std::strong_ordering> || std::same_as<T, std::weak_ordering>
Expand Down Expand Up @@ -71,7 +71,7 @@ namespace sparrow
constexpr auto lexicographical_compare_three_way(const R1& range1, const R2& range2, Cmp comp)
-> decltype(comp(*range1.cbegin(), *range2.cbegin()))
{
#if COMPILING_WITH_APPLE_CLANG
#if COMPILING_WITH_APPLE_CLANG || USING_LIBCPP_PRE_17
return lexicographical_compare_three_way_non_std(range1, range2, comp);
#else
return std::lexicographical_compare_three_way(
Expand All @@ -84,7 +84,7 @@ namespace sparrow
#endif
}

#if COMPILING_WITH_APPLE_CLANG
#if COMPILING_WITH_APPLE_CLANG || USING_LIBCPP_PRE_17
struct compare_three_way
{
template <class T, class U>
Expand All @@ -109,7 +109,7 @@ namespace sparrow
return lexicographical_compare_three_way<R1, R2>(
r1,
r2,
#if COMPILING_WITH_APPLE_CLANG
#if COMPILING_WITH_APPLE_CLANG || USING_LIBCPP_PRE_17
compare_three_way {}
#else
std::compare_three_way{}
Expand Down
6 changes: 6 additions & 0 deletions include/sparrow/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
#define COMPILING_WITH_APPLE_CLANG 0
#endif

#if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION < 170000
#define USING_LIBCPP_PRE_17 1
#else
#define USING_LIBCPP_PRE_17 0
#endif

consteval bool is_apple_compiler()
{
return static_cast<bool>(COMPILING_WITH_APPLE_CLANG);
Expand Down