Static builds on windows incorrect. Missing PKGCONFIG_IS_STATIC preprocessor def #222

Closed
opened 2021-04-24 20:57:55 +00:00 by Neumann-A · 0 comments
Neumann-A commented 2021-04-24 20:57:55 +00:00 (Migrated from github.com)

Applied the following patch:

diff --git a/meson.build b/meson.build
index e7822b8da..8f7aa0075 100644
--- a/meson.build
+++ b/meson.build
@@ -45,6 +45,13 @@ cdata.set('abs_top_builddir', meson.build_root())

 subdir('libpkgconf')

+libtype = get_option('default_library')
+if libtype == 'static'
+  build_static = '-DPKGCONFIG_IS_STATIC'
+else
+  build_static = ''
+endif
+
 libpkgconf = library('pkgconf',
   'libpkgconf/argvsplit.c',
   'libpkgconf/audit.c',
@@ -60,7 +67,7 @@ libpkgconf = library('pkgconf',
   'libpkgconf/pkg.c',
   'libpkgconf/queue.c',
   'libpkgconf/tuple.c',
-  c_args: '-DLIBPKGCONF_EXPORT',
+  c_args: ['-DLIBPKGCONF_EXPORT', build_static],
   install : true,
   version : '3.0.0',
   soversion : '3',
@@ -73,13 +80,16 @@ pkg.generate(libpkgconf,
   url: 'http://github.com/pkgconf/pkgconf',
   filebase : 'libpkgconf',
   subdirs: ['pkgconf'],
+  extra_cflags : build_static
 )

+
 pkgconf_exe = executable('pkgconf',
   'cli/main.c',
   'cli/getopt_long.c',
   'cli/renderer-msvc.c',
   link_with : libpkgconf,
+  c_args: build_static,
   install : true)

 if get_option('tests')
Applied the following patch: ``` diff --git a/meson.build b/meson.build index e7822b8da..8f7aa0075 100644 --- a/meson.build +++ b/meson.build @@ -45,6 +45,13 @@ cdata.set('abs_top_builddir', meson.build_root()) subdir('libpkgconf') +libtype = get_option('default_library') +if libtype == 'static' + build_static = '-DPKGCONFIG_IS_STATIC' +else + build_static = '' +endif + libpkgconf = library('pkgconf', 'libpkgconf/argvsplit.c', 'libpkgconf/audit.c', @@ -60,7 +67,7 @@ libpkgconf = library('pkgconf', 'libpkgconf/pkg.c', 'libpkgconf/queue.c', 'libpkgconf/tuple.c', - c_args: '-DLIBPKGCONF_EXPORT', + c_args: ['-DLIBPKGCONF_EXPORT', build_static], install : true, version : '3.0.0', soversion : '3', @@ -73,13 +80,16 @@ pkg.generate(libpkgconf, url: 'http://github.com/pkgconf/pkgconf', filebase : 'libpkgconf', subdirs: ['pkgconf'], + extra_cflags : build_static ) + pkgconf_exe = executable('pkgconf', 'cli/main.c', 'cli/getopt_long.c', 'cli/renderer-msvc.c', link_with : libpkgconf, + c_args: build_static, install : true) if get_option('tests') ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#222
There is no content yet.