Skip to content

Commit f35f371

Browse files
author
AlexanderMueller
committed
added ifs for MINGW compilation
1 parent a5fbee5 commit f35f371

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

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)