Skip to content

Commit 5aa200a

Browse files
authored
Enable building with GCC 14 (#15)
When I tried to build the package with GCC 14, I got the following error: src/ThirdParty/Minizip/minizip/miniunz.c:141:11: error: implicit declaration of function ‘mkdir’; did you mean ‘mymkdir’? [-Wimplicit-function-declaration] It turns out that GCC now conforms more strictly to the C standard, and some issues that were previously only warned about are now treated as errors. `implicit-function-declaration` is one of these. For more info, see: https://gcc.gnu.org/gcc-14/porting_to.html#implicit-function-declaration The solution is to patch the Minizip code so that the appropriate header for `mkdir()`, which is `<sys/stat.h>`, gets included.
1 parent 10ef51e commit 5aa200a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

add-missing-minizip-include.patch

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/ThirdParty/Minizip/minizip/miniunz.c b/ThirdParty/Minizip/minizip/miniunz.c
2+
index 2264705..9d2130c 100644
3+
--- a/ThirdParty/Minizip/minizip/miniunz.c
4+
+++ b/ThirdParty/Minizip/minizip/miniunz.c
5+
@@ -51,6 +51,7 @@
6+
# include <direct.h>
7+
# include <io.h>
8+
#else
9+
+# include <sys/stat.h>
10+
# include <unistd.h>
11+
# include <utime.h>
12+
#endif

conanfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ class FMILibraryConan(ConanFile):
2020
tool_requires = "cmake/[>=3.15]"
2121
generators = "CMakeDeps"
2222

23-
exports_sources = "build-static-c99snprintf.patch"
23+
exports_sources = [
24+
"add-missing-minizip-include.patch",
25+
"build-static-c99snprintf.patch",
26+
]
2427

2528
def source(self):
2629
git = Git(self)
2730
git.clone(url="https://github.com/modelon-community/fmi-library.git", target="src", args=["--branch=2.3"])
31+
patch(self, base_path="src", patch_file="add-missing-minizip-include.patch")
2832
patch(self, base_path="src", patch_file="build-static-c99snprintf.patch")
2933

3034
def layout(self):

0 commit comments

Comments
 (0)