Skip to content

Commit 4e56dee

Browse files
authored
compat.fribidi: -fPIC on linux and macOS only; static entry points on windows (#577)
clang rejects -fPIC for the MSVC target ("unsupported option '-fPIC' for target 'x86_64-pc-windows-msvc'"), and PE/COFF has no such distinction. On windows fribidi-common.h makes every entry point dllexport/dllimport unless FRIBIDI_LIB_STATIC is defined; this package builds a static library, so it is.
1 parent 0c2ede8 commit 4e56dee

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎pkgs/c/compat.fribidi.lua‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,17 @@ package = {
173173
-- Upstream's own, from lib/meson.build: without it every public
174174
-- symbol would be hidden and pango would fail to link.
175175
"-DFRIBIDI_BUILD",
176-
-- pango is linked into shared objects, so the objects must be
177-
-- position independent.
178-
"-fPIC",
179176
},
177+
-- pango is linked into shared objects, so the objects must be
178+
-- position independent. Not on windows: PE/COFF has no such
179+
-- distinction, and clang rejects -fPIC for the MSVC target.
180+
linux = { cflags = { "-fPIC" } },
181+
macosx = { cflags = { "-fPIC" } },
182+
-- This is a static library: under _WIN32 fribidi-common.h would make
183+
-- every entry point __declspec(dllexport) (dllimport for consumers)
184+
-- unless FRIBIDI_LIB_STATIC says otherwise. A consumer that includes
185+
-- the headers on windows defines it too.
186+
windows = { cflags = { "-DFRIBIDI_LIB_STATIC" } },
180187

181188
targets = { fribidi = { kind = "lib" } },
182189
},

0 commit comments

Comments
 (0)