Skip to content

Commit ea7b8fa

Browse files
committed
Build fix on windows
Build environment gcc-9 for linux Update CI
1 parent 9ed1bc8 commit ea7b8fa

File tree

3 files changed

+13
-47
lines changed

3 files changed

+13
-47
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,85 @@
1-
name: Build
1+
name: CI
22

33
on: [push]
44

55
env:
6-
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
76
BUILD_TYPE: Release
87

98
jobs:
109
linux:
11-
# The CMake configure and build commands are platform agnostic and should work equally
12-
# well on Windows or Mac. You can convert this to a matrix build if you need
13-
# cross-platform coverage.
14-
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
1510
runs-on: ubuntu-latest
1611

1712
steps:
1813
- uses: actions/checkout@v2
1914

15+
- name: Install gcc-9
16+
run: |
17+
sudo apt-get install -y g++-9
18+
echo "::set-env name=CC::gcc-9"
19+
echo "::set-env name=CXX::g++-9"
20+
2021
- name: Create Build Environment
21-
# Some projects don't allow in-source building, so create a separate build directory
22-
# We'll use this as our working directory for all subsequent commands
2322
run: cmake -E make_directory ${{runner.workspace}}/build
2423

2524
- name: Configure CMake
26-
# Use a bash shell so we can use the same syntax for environment variable
27-
# access regardless of the host operating system
2825
shell: bash
2926
working-directory: ${{runner.workspace}}/build
30-
# Note the current convention is to use the -S and -B options here to specify source
31-
# and build directories, but this is only available with CMake 3.13 and higher.
32-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
3327
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
3428

3529
- name: Build
3630
working-directory: ${{runner.workspace}}/build
3731
shell: bash
38-
# Execute the build. You can specify a specific target with "--target <NAME>"
3932
run: cmake --build . --config $BUILD_TYPE
4033

4134
- name: Test
4235
working-directory: ${{runner.workspace}}/build
4336
shell: bash
44-
# Execute tests defined by the CMake configuration.
45-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
4637
run: ctest -C $BUILD_TYPE
38+
4739
macOS:
48-
# The CMake configure and build commands are platform agnostic and should work equally
49-
# well on Windows or Mac. You can convert this to a matrix build if you need
50-
# cross-platform coverage.
51-
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
5240
runs-on: macos-latest
5341

5442
steps:
5543
- uses: actions/checkout@v2
5644

5745
- name: Create Build Environment
58-
# Some projects don't allow in-source building, so create a separate build directory
59-
# We'll use this as our working directory for all subsequent commands
6046
run: cmake -E make_directory ${{runner.workspace}}/build
6147

6248
- name: Configure CMake
63-
# Use a bash shell so we can use the same syntax for environment variable
64-
# access regardless of the host operating system
6549
shell: bash
6650
working-directory: ${{runner.workspace}}/build
67-
# Note the current convention is to use the -S and -B options here to specify source
68-
# and build directories, but this is only available with CMake 3.13 and higher.
69-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
7051
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
7152

7253
- name: Build
7354
working-directory: ${{runner.workspace}}/build
7455
shell: bash
75-
# Execute the build. You can specify a specific target with "--target <NAME>"
7656
run: cmake --build . --config $BUILD_TYPE
7757

7858
- name: Test
7959
working-directory: ${{runner.workspace}}/build
8060
shell: bash
81-
# Execute tests defined by the CMake configuration.
82-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
8361
run: ctest -C $BUILD_TYPE
62+
8463
windows:
85-
# The CMake configure and build commands are platform agnostic and should work equally
86-
# well on Windows or Mac. You can convert this to a matrix build if you need
87-
# cross-platform coverage.
88-
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#configuring-a-build-matrix
8964
runs-on: windows-latest
9065

9166
steps:
9267
- uses: actions/checkout@v2
9368

9469
- name: Create Build Environment
95-
# Some projects don't allow in-source building, so create a separate build directory
96-
# We'll use this as our working directory for all subsequent commands
9770
run: cmake -E make_directory ${{runner.workspace}}/build
9871

9972
- name: Configure CMake
100-
# Use a bash shell so we can use the same syntax for environment variable
101-
# access regardless of the host operating system
10273
shell: bash
10374
working-directory: ${{runner.workspace}}/build
104-
# Note the current convention is to use the -S and -B options here to specify source
105-
# and build directories, but this is only available with CMake 3.13 and higher.
106-
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
10775
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
10876

10977
- name: Build
11078
working-directory: ${{runner.workspace}}/build
11179
shell: bash
112-
# Execute the build. You can specify a specific target with "--target <NAME>"
11380
run: cmake --build . --config $BUILD_TYPE
11481

11582
- name: Test
11683
working-directory: ${{runner.workspace}}/build
11784
shell: bash
118-
# Execute tests defined by the CMake configuration.
119-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
12085
run: ctest -C $BUILD_TYPE
121-
122-
123-

source/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ project(modern.cpp.logger)
3333
include_directories(../3rdparty)
3434

3535
add_library(${PROJECT_NAME}
36+
../.github/workflows/build.yml
3637
../README.md
3738
../3rdparty/magic_enum.hpp
3839
../3rdparty/Singleton.h

source/XmlFileLogger.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
/* stl header */
32+
#include <algorithm>
33+
3134
/* magic enum */
3235
#include <magic_enum.hpp>
3336

0 commit comments

Comments
 (0)