Skip to content

Commit 7f3b007

Browse files
Merge pull request #163 from rath3t/addMinGWconf2
Add MinGW workflow
2 parents 2910484 + f35f371 commit 7f3b007

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
config:
3131
# see: https://github.com/actions/virtual-environments
3232
- {
33-
name: "Windows/2019/Static/X86/Release",
33+
name: "Windows-MSVC/2019/Static/X86/Release",
3434
os: windows-2019,
3535
config: Release,
3636
cmake_extra_args: -G "Visual Studio 16 2019" -A Win32,
@@ -39,14 +39,23 @@ jobs:
3939
cores: 2,
4040
}
4141
- {
42-
name: "Windows/2019/Static/X64/Release",
42+
name: "Windows-MSVC/2019/Static/X64/Release",
4343
os: windows-2019,
4444
config: Release,
4545
cmake_extra_args: -G "Visual Studio 16 2019" -A x64 -DCMAKE_CXX_FLAGS="/O2",
4646
sudocmd: "",
4747
artifact_name: "Windows x64",
4848
cores: 2,
4949
}
50+
- {
51+
name: "Windows-MinGW/2019/Static/X64/Release",
52+
os: windows-2019,
53+
config: Release,
54+
cmake_extra_args: "-G \"MinGW Makefiles\" -DCMAKE_C_COMPILER=C:/msys64/mingw64/bin/gcc.exe -DCMAKE_CXX_COMPILER=C:/msys64/mingw64/bin/g++.exe",
55+
sudocmd: "",
56+
artifact_name: "Windows x64",
57+
cores: 2,
58+
}
5059
- {
5160
name: "Ubuntu/18.04/Static/X64/Release",
5261
os: ubuntu-18.04,

source/matplot/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
if(NOT MINGW)
12
find_package(Filesystem REQUIRED COMPONENTS Experimental Final)
3+
endif()
24

35
#######################################################
46
### Library ###
@@ -97,8 +99,13 @@ target_include_directories(matplot
9799
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
98100

99101
# Dependencies
102+
if(NOT MINGW)
100103
target_link_libraries_system(matplot
101104
PRIVATE cimg nodesoup std::filesystem)
105+
else()
106+
target_link_libraries_system(matplot
107+
PRIVATE cimg nodesoup)
108+
endif()
102109

103110
# Required compiler features required
104111
# https://cmake.org/cmake/help/v3.14/manual/cmake-compile-features.7.html#requiring-language-standards
@@ -122,10 +129,11 @@ maybe_target_pedantic_warnings(matplot)
122129
### Definitions ###
123130
#######################################################
124131
# Use experimental filesystem if std::filesystem is not available yet
125-
if (CXX_FILESYSTEM_IS_EXPERIMENTAL)
126-
target_compile_definitions(matplot PRIVATE CXX_FILESYSTEM_IS_EXPERIMENTAL)
132+
if(NOT MINGW)
133+
if (CXX_FILESYSTEM_IS_EXPERIMENTAL)
134+
target_compile_definitions(matplot PRIVATE CXX_FILESYSTEM_IS_EXPERIMENTAL)
135+
endif()
127136
endif()
128-
129137
# Some hack to not depend on FILE* internals
130138
# https://github.com/alandefreitas/matplotplusplus/issues/4
131139
include(CheckSymbolExists)

test/generate_examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
if(NOT MINGW)
12
find_package(Filesystem REQUIRED)
3+
endif()
24
add_executable(generate_examples main.cpp)
5+
if(NOT MINGW)
36
target_link_libraries(generate_examples std::filesystem)
7+
endif()
48
target_compile_features(generate_examples PRIVATE cxx_std_17)

0 commit comments

Comments
 (0)