Skip to content

Commit 591dc47

Browse files
committed
Disable C++26 for now and fix MacOS and Windows workflows
1 parent b3a1229 commit 591dc47

File tree

8 files changed

+27
-22
lines changed

8 files changed

+27
-22
lines changed

.github/workflows/build-macos-x86_64.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
with:
1111
submodules: recursive
1212

13-
- name: Install wxWidgets
14-
run: brew install wxwidgets dylibbundler create-dmg
13+
- name: Install dependencies
14+
run: brew install wxwidgets@3.2 dylibbundler create-dmg llvm
1515

1616
- name: Generate Makefile
17-
run: cmake . -DCMAKE_BUILD_TYPE=Release
17+
run: CXX=$(brew --prefix llvm)/bin/clang++ cmake . -DCMAKE_BUILD_TYPE=Release -DCEDIMU_ENABLE_LTO=OFF
1818

1919
- name: Build
2020
run: make -j$(sysctl -n hw.physicalcpu)

.github/workflows/build-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
path: ./build/Release/CeDImu.exe
3535

3636
- name: Run tests
37-
run: ./build/tests/tests
37+
run: ./build/tests/Release/tests.exe

benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.25)
33

44
project(CeDImu-benchmarks)
55

6-
set(CMAKE_CXX_STANDARD 26)
6+
set(CMAKE_CXX_STANDARD 23)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
88

99
if(NOT CMAKE_BUILD_TYPE)

src/CDI/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(libCeDImu)
44

55
set(CMAKE_C_STANDARD 23)
66
set(CMAKE_C_STANDARD_REQUIRED ON)
7-
set(CMAKE_CXX_STANDARD 26)
7+
set(CMAKE_CXX_STANDARD 23)
88
set(CMAKE_CXX_STANDARD_REQUIRED ON)
99
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
1010
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

src/CDI/Video/Pixel.hpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
#include <bit>
55
#include <cstdint>
6-
#include <stdbit.h>
6+
// #include <stdbit.h>
77

8-
#if __STDC_VERSION_STDBIT_H__ < 202311L
9-
#error need __STDC_ENDIAN_NATIVE__ compiler support
10-
#endif
8+
// #if __STDC_VERSION_STDBIT_H__ < 202311L
9+
// #error need __STDC_ENDIAN_NATIVE__ compiler support
10+
// #endif
1111

12-
#if __STDC_ENDIAN_NATIVE__ != __STDC_ENDIAN_LITTLE__ && __STDC_ENDIAN_NATIVE__ != __STDC_ENDIAN_BIG__
13-
#error requires a regular little-endian or big-endian machine
14-
#endif
12+
// #if __STDC_ENDIAN_NATIVE__ != __STDC_ENDIAN_LITTLE__ && __STDC_ENDIAN_NATIVE__ != __STDC_ENDIAN_BIG__
13+
// #error requires a regular little-endian or big-endian machine
14+
// #endif
1515

1616
namespace Video
1717
{
@@ -20,22 +20,24 @@ namespace Video
2020
*/
2121
struct alignas(uint32_t) Pixel
2222
{
23+
static_assert(std::endian::native == std::endian::little);
24+
2325
/** \brief Type alias to allow for raw manipulation. */
2426
using ARGB32 = uint32_t;
2527

2628
constexpr Pixel() : Pixel(0) {}
2729

28-
#if __STDC_ENDIAN_NATIVE__ == __STDC_ENDIAN_LITTLE__
30+
// #if __STDC_ENDIAN_NATIVE__ == __STDC_ENDIAN_LITTLE__
2931
constexpr Pixel(ARGB32 argb) : b(argb), g(argb >> 8), r(argb >> 16), a(argb >> 24) {}
3032
constexpr Pixel(uint8_t A, uint8_t R, uint8_t G, uint8_t B) : b{B}, g{G}, r{R}, a{A} {}
3133

3234
uint8_t b, g, r, a;
33-
#else
34-
constexpr Pixel(ARGB32 argb) : a(argb >> 24), r(argb >> 16), g(argb >> 8), b(argb) {}
35-
constexpr Pixel(uint8_t A, uint8_t R, uint8_t G, uint8_t B) : a{A}, r{R}, g{G}, b{B} {}
35+
// #else
36+
// constexpr Pixel(ARGB32 argb) : a(argb >> 24), r(argb >> 16), g(argb >> 8), b(argb) {}
37+
// constexpr Pixel(uint8_t A, uint8_t R, uint8_t G, uint8_t B) : a{A}, r{R}, g{G}, b{B} {}
3638

37-
uint8_t a, r, g, b;
38-
#endif // __STDC_ENDIAN_NATIVE__
39+
// uint8_t a, r, g, b;
40+
// #endif // __STDC_ENDIAN_NATIVE__
3941

4042
constexpr ARGB32 AsU32() const noexcept { return static_cast<ARGB32>(*this); }
4143

src/CDI/common/Audio.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#include "Audio.hpp"
22
#include "utils.hpp"
33

4+
#include <bit>
5+
46
namespace Audio
57
{
68

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endif()
88

99
option(CEDIMU_ENABLE_LTO "Enable LTO if available" ON)
1010

11-
set(CMAKE_CXX_STANDARD 26)
11+
set(CMAKE_CXX_STANDARD 23)
1212
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1313
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
1414

tests/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
set(CMAKE_CXX_STANDARD 26)
1+
set(CMAKE_CXX_STANDARD 23)
22
set(CMAKE_CXX_STANDARD_REQUIRED ON)
33

44
add_executable(tests
55
testVideoDecoders.cpp
66
)
77

8-
target_compile_options(tests PRIVATE -Wall -Wextra -pedantic)
98
target_link_libraries(tests PRIVATE Catch2::Catch2WithMain CeDImu)
109

1110
option(CEDIMU_TESTS_ASAN "Add address sanitizer options for the unit tests" OFF)
1211
message("CeDImu tests sanitize: " ${CEDIMU_TESTS_ASAN})
1312

1413
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # Common flags for GCC and Clang.
14+
target_compile_options(tests PRIVATE -Wall -Wextra -pedantic)
15+
1516
if(CEDIMU_TESTS_ASAN)
1617
target_compile_options(tests PRIVATE -fsanitize=address)
1718
target_link_options(tests PUBLIC -fsanitize=address -static-libasan)

0 commit comments

Comments
 (0)