File tree 5 files changed +54
-5
lines changed
5 files changed +54
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : CI
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ build-linux :
7
+ name : ubuntu-22.04-release
8
+ runs-on : ubuntu-22.04
9
+ defaults :
10
+ run :
11
+ shell : bash -e -o pipefail {0}
12
+ steps :
13
+ - name : checkout repository
14
+ uses : actions/checkout@v4
15
+ - name : check format
16
+ run : ./format-files.sh check
17
+ - name : configure
18
+ run : cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
19
+ - name : build
20
+ run : cmake --build build
21
+ - name : test
22
+ run : ctest --test-dir build --output-on-failure
23
+ - name : install
24
+ run : sudo cmake --install build
25
+ build-windows :
26
+ name : windows-2022-release
27
+ runs-on : windows-2022
28
+ defaults :
29
+ run :
30
+ shell : C:\msys64\usr\bin\bash.exe {0}
31
+ steps :
32
+ - name : checkout repository
33
+ uses : actions/checkout@v4
34
+ - name : configure
35
+ run : cmake -S . -B build -G "Visual Studio 17 2022"
36
+ - name : build
37
+ run : cmake --build build --config Release
38
+ - name : test
39
+ run : ctest --test-dir build --output-on-failure
40
+ - name : install
41
+ run : cmake --install build --config Release
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD 17)
9
9
set (CMAKE_CXX_STANDARD_REQUIRED True )
10
10
11
11
if (MSVC )
12
- set (CMAKE_CXX_FLAGS "/EHsc /Wall " )
12
+ set (CMAKE_CXX_FLAGS "/EHsc /W3 " )
13
13
set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
14
14
set (CMAKE_CXX_FLAGS_RELEASE "/O2" )
15
15
add_compile_definitions (_USE_MATH_DEFINES)
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
+ set -euo pipefail
4
+
5
+ MODE=" ${1:- default} "
6
+
3
7
PROJ_ROOT=$( dirname $0 )
4
8
5
9
if ! type -p clang-format > /dev/null; then
21
25
exit 1
22
26
fi
23
27
28
+ EXTRA_FLAGS=" "
29
+ if [[ " $MODE " == " check" ]]; then
30
+ echo " check mode enabled, not formatting files, only checking"
31
+ EXTRA_FLAGS=" --dry-run --Werror"
32
+ fi
33
+
24
34
find " ${PROJ_ROOT} " -type f \
25
35
\( -name " *.cpp" -o -name " *.c" -o -name " *.hpp" -o -name " *.h" \) \
26
36
-not -path " ${PROJ_ROOT} /build/*" \
27
- -print -exec clang-format --style=file -i ' {} ' \;
37
+ -print0 | xargs -0 clang-format $EXTRA_FLAGS --style=file --verbose -i
Original file line number Diff line number Diff line change 1
1
#pragma once
2
- #define _USE_MATH_DEFINES
3
2
#include < algorithm>
4
3
#include < array>
5
4
#include < cmath>
Original file line number Diff line number Diff line change 35
35
*/
36
36
37
37
/* ====== INCLUSIONS ====== */
38
- #include < stdio.h>
39
- #define _USE_MATH_DEFINES
40
38
#include < math.h>
39
+ #include < stdio.h>
41
40
42
41
namespace odr
43
42
{
You can’t perform that action at this time.
0 commit comments