Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions pkgs/c/compat.freetype.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,24 @@ package = {
},
targets = { ["freetype"] = { kind = "lib" } },
deps = { ["compat.libpng"] = "1.6.43" },
cflags = { "-DFT2_BUILD_LIBRARY", "-DFT_DISABLE_ZLIB", "-DFT_DISABLE_BZIP2", "-DFT_DISABLE_HARFBUZZ", "-DFT_DISABLE_BROTLI", "-Wno-implicit-function-declaration", "-D_DARWIN_C_SOURCE" },
-- Only the FT_* configuration defines are portable. `cl` accepts -D, so
-- these reach MSVC unchanged; a -W switch does not -- see below.
cflags = { "-DFT2_BUILD_LIBRARY", "-DFT_DISABLE_ZLIB", "-DFT_DISABLE_BZIP2", "-DFT_DISABLE_HARFBUZZ", "-DFT_DISABLE_BROTLI" },
linux = {
ldflags = { "-lm" },
sources = { "*/builds/unix/ftsystem.c", "*/src/base/ftdebug.c" },
cflags = { "-include", "fcntl.h" },
-- -Wno-implicit-function-declaration is a GCC/Clang switch. It used
-- to sit in the common cflags, where MSVC rejected it outright with
-- `D8021: invalid numeric argument`, so the package could not build
-- on Windows at all.
cflags = { "-include", "fcntl.h", "-Wno-implicit-function-declaration" },
},
macosx = {
ldflags = { "-lm" },
sources = { "*/builds/unix/ftsystem.c", "*/src/base/ftdebug.c" },
cflags = { "-include", "fcntl.h" },
-- _DARWIN_C_SOURCE belongs here and nowhere else; it was in the
-- common cflags, which put an Apple feature macro on every platform.
cflags = { "-include", "fcntl.h", "-Wno-implicit-function-declaration", "-D_DARWIN_C_SOURCE" },
},
windows = {
sources = {
Expand Down
12 changes: 11 additions & 1 deletion pkgs/c/compat.zlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ package = {
import_std = false,
c_standard = "c11",
include_dirs = {"*", "mcpp_generated/include"},
cflags = { "-D_GNU_SOURCE", "-include mcpp_zlib_config.h" },
-- Both of these are GCC/Clang-only and used to be unconditional.
-- `-include` is the worse of the two on MSVC: cl does not reject it, it
-- warns (`D9002 ignoring unknown option`) and carries on, so the config
-- header was silently never included. The header only defines anything
-- when _WIN32 is absent, so Windows needs neither.
linux = {
cflags = { "-D_GNU_SOURCE", "-include", "mcpp_zlib_config.h" },
},
macosx = {
cflags = { "-include", "mcpp_zlib_config.h" },
},
generated_files = {
["mcpp_generated/include/mcpp_zlib_config.h"] = "#ifndef MCPP_ZLIB_CONFIG_H\n#define MCPP_ZLIB_CONFIG_H\n#if !defined(_WIN32)\n#define Z_HAVE_UNISTD_H 1\n#endif\n#endif\n",
},
Expand Down
Loading