Skip to content

Commit 9504728

Browse files
Fix macOS compiler (#9)
* Fix macOS compiler * Use ninja generator for windows integration * Fix integration * Download ninja dependency with choco * Shortening compiler * Another path for integration * Fix windows environment * Even more compiler foo * Use msbuild action * Attach compiler to cmake * Make compiler per environment * Fix re2 build * Fix iterator debug level foo * Fix codeql workflow for windows
1 parent d5f5611 commit 9504728

File tree

7 files changed

+45
-51
lines changed

7 files changed

+45
-51
lines changed

.github/workflows/windows-codeql.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
name: ${{matrix.name}} (${{matrix.config}})
99
runs-on: ${{matrix.os}}
1010

11+
env:
12+
CMAKE_GENERATOR: Ninja
13+
1114
strategy:
1215
fail-fast: false
1316
matrix:
@@ -26,58 +29,54 @@ jobs:
2629
- name: windows-2019-msvc2019
2730
os: windows-2019
2831
compiler: cl
29-
version: Visual Studio 16 2019
30-
architecture: -A x64
32+
architecture: x64
3133

3234
- name: windows-2019-msvc2019-win32
3335
os: windows-2019
3436
compiler: cl
35-
version: Visual Studio 16 2019
36-
architecture: -A Win32
37+
architecture: x86
3738

3839
- name: windows-2019-msvc2019-arm64
3940
os: windows-2019
4041
compiler: cl
41-
version: Visual Studio 16 2019
42-
architecture: -A ARM64
42+
architecture: x64_arm64
4343

4444
- name: windows-2019-msvc2019-clang
4545
os: windows-2019
4646
compiler: clang-cl
47-
version: Visual Studio 16 2019
48-
architecture: -A x64
49-
toolchain: -T ClangCl
47+
architecture: x64
5048

5149
- name: windows-2022-msvc2022
5250
os: windows-2022
5351
compiler: cl
54-
version: Visual Studio 17 2022
55-
architecture: -A x64
52+
architecture: x64
5653

5754
- name: windows-2022-msvc2022-win32
5855
os: windows-2022
5956
compiler: cl
60-
version: Visual Studio 17 2022
61-
architecture: -A Win32
57+
architecture: x86
6258

6359
- name: windows-2022-msvc2022-arm64
6460
os: windows-2022
6561
compiler: cl
66-
version: Visual Studio 17 2022
67-
architecture: -A ARM64
62+
architecture: x64_arm64
6863

6964
- name: windows-2022-msvc2022-clang
7065
os: windows-2022
7166
compiler: clang-cl
72-
version: Visual Studio 17 2022
73-
architecture: -A x64
74-
toolchain: -T ClangCl
67+
architecture: x64
7568

7669
steps:
7770
- uses: actions/checkout@v3
71+
- uses: ilammy/msvc-dev-cmd@v1
72+
with:
73+
arch: ${{matrix.architecture}}
7874

7975
- name: Dependencies
80-
run: choco install doxygen.install graphviz -y
76+
run: |
77+
choco install doxygen.install graphviz ninja -y
78+
echo "CC=${{matrix.compiler}}" >> $env:GITHUB_ENV
79+
echo "CXX=${{matrix.compiler}}" >> $env:GITHUB_ENV
8180
8281
- name: Initialize CodeQL
8382
if: matrix.compiler != 'clang-cl'
@@ -90,7 +89,7 @@ jobs:
9089

9190
- name: Configure CMake
9291
working-directory: ${{runner.workspace}}/build
93-
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}} -G"${{matrix.version}}" ${{matrix.architecture}} ${{matrix.toolchain}}
92+
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}}
9493

9594
- name: Build
9695
working-directory: ${{runner.workspace}}/build

.github/workflows/windows.yml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ jobs:
88
name: ${{matrix.name}} (${{matrix.config}})
99
runs-on: ${{matrix.os}}
1010

11+
env:
12+
CMAKE_GENERATOR: Ninja
13+
1114
strategy:
1215
fail-fast: false
1316
matrix:
@@ -26,72 +29,68 @@ jobs:
2629
- name: windows-2019-msvc2019
2730
os: windows-2019
2831
compiler: cl
29-
version: Visual Studio 16 2019
30-
architecture: -A x64
32+
architecture: x64
3133

3234
- name: windows-2019-msvc2019-win32
3335
os: windows-2019
3436
compiler: cl
35-
version: Visual Studio 16 2019
36-
architecture: -A Win32
37+
architecture: x86
3738

3839
- name: windows-2019-msvc2019-arm64
3940
os: windows-2019
4041
compiler: cl
41-
version: Visual Studio 16 2019
42-
architecture: -A ARM64
42+
architecture: x64_arm64
4343

4444
- name: windows-2019-msvc2019-clang
4545
os: windows-2019
4646
compiler: clang-cl
47-
version: Visual Studio 16 2019
48-
architecture: -A x64
49-
toolchain: -T ClangCl
47+
architecture: x64
5048

5149
- name: windows-2022-msvc2022
5250
os: windows-2022
5351
compiler: cl
54-
version: Visual Studio 17 2022
55-
architecture: -A x64
52+
architecture: x64
5653

5754
- name: windows-2022-msvc2022-win32
5855
os: windows-2022
5956
compiler: cl
60-
version: Visual Studio 17 2022
61-
architecture: -A Win32
57+
architecture: x86
6258

6359
- name: windows-2022-msvc2022-arm64
6460
os: windows-2022
6561
compiler: cl
66-
version: Visual Studio 17 2022
67-
architecture: -A ARM64
62+
architecture: x64_arm64
6863

6964
- name: windows-2022-msvc2022-clang
7065
os: windows-2022
7166
compiler: clang-cl
72-
version: Visual Studio 17 2022
73-
architecture: -A x64
74-
toolchain: -T ClangCl
67+
architecture: x64
7568

7669
steps:
7770
- uses: actions/checkout@v3
71+
- uses: ilammy/msvc-dev-cmd@v1
72+
with:
73+
arch: ${{matrix.architecture}}
7874

7975
- name: Dependencies
80-
run: choco install doxygen.install graphviz -y
76+
run: |
77+
choco install doxygen.install graphviz ninja -y
78+
echo "CC=${{matrix.compiler}}" >> $env:GITHUB_ENV
79+
echo "CXX=${{matrix.compiler}}" >> $env:GITHUB_ENV
8180
8281
- name: Create Build Environment
8382
run: cmake -E make_directory ${{runner.workspace}}/build
8483

8584
- name: Configure CMake
8685
working-directory: ${{runner.workspace}}/build
87-
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}} -G"${{matrix.version}}" ${{matrix.architecture}} ${{matrix.toolchain}}
86+
run: cmake $env:GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE:STRING=${{matrix.config}}
8887

8988
- name: Build
9089
working-directory: ${{runner.workspace}}/build
9190
run: cmake --build . --config ${{matrix.config}}
9291

9392
- name: Test
94-
if: matrix.architecture != '-A ARM64'
93+
if: matrix.architecture != 'x64_arm64'
9594
working-directory: ${{runner.workspace}}/build
9695
run: ctest --output-on-failure -C ${{matrix.config}}
9796

cmake/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
env.cmake
66
Environment variables
77

8-
doxygen.cmake
9-
Template for running doxygen - not yet usable
8+
documentation.cmake
9+
Template for running doxygen
1010

1111
find_package.cmake
1212
Overall find package to use these variables in other cmake files

cmake/external/googletest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if(UNIX)
3737
set(GOOGLETEST_OS_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
3838
else()
3939
set(GOOGLETEST_LIBRARY ${GOOGLETEST_INSTALL}/lib/gtest.lib)
40-
set(GOOGLETEST_OS_ARGS -Dgtest_force_shared_crt:BOOL=ON)
40+
set(GOOGLETEST_OS_ARGS -Dgtest_force_shared_crt:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
4141
endif()
4242
set(GOOGLETEST_INCLUDE_DIR ${GOOGLETEST_INSTALL}/include)
4343

cmake/external/re2.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ set(RE2_SRC ${CMAKE_BINARY_DIR}/_deps/re2-src)
3434
set(RE2_INSTALL ${CMAKE_BINARY_DIR}/_deps/re2-install)
3535
if(UNIX)
3636
set(RE2_LIBRARY ${RE2_INSTALL}/lib/libre2.a)
37-
set(RE2_OS_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
3837
else()
3938
set(RE2_LIBRARY ${RE2_INSTALL}/lib/re2.lib)
4039
endif()
40+
set(RE2_OS_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
4141
set(RE2_INCLUDE_DIR ${RE2_INSTALL}/include)
4242
if (WIN32)
4343
set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} /EHsc")

source/StringUtils.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ namespace vx::string_utils {
135135
constexpr bool bothAreSpaces( char _left,
136136
char _right ) noexcept { return std::equal_to<> {}( _left, _right ) && std::equal_to<> {}( _left, ' ' ); }
137137

138-
std::string &simplified( std::string &_string ) noexcept {
138+
std::string &simplified( std::string &_string ) {
139139

140140
/* Replace every control with a space */
141141
std::ranges::replace( _string, '\t', ' ' );
@@ -145,11 +145,7 @@ namespace vx::string_utils {
145145
std::ranges::replace( _string, '\v', ' ' );
146146

147147
/* Normalize spaces to just one */
148-
#if defined _MSC_VER || ( defined __GNUC__ && __GNUC__ >= 10 )
149148
const auto newEnd = std::unique( std::begin( _string ), std::end( _string ), bothAreSpaces );
150-
#else
151-
const auto newEnd = std::ranges::unique( _string, bothAreSpaces );
152-
#endif
153149
_string.erase( newEnd, std::cend( _string ) );
154150

155151
/* Trim */

source/StringUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace vx::string_utils {
116116
* Default: Space, tabs, return, new line and form feed.
117117
* @return Simplified string.
118118
*/
119-
std::string &simplified( std::string &_string ) noexcept;
119+
std::string &simplified( std::string &_string );
120120

121121
/**
122122
* @brief Tokenize string by separator.

0 commit comments

Comments
 (0)