Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cwalk: new package #1387

Merged
merged 1 commit into from
Jun 25, 2024
Merged

cwalk: new package #1387

merged 1 commit into from
Jun 25, 2024

Conversation

antoniovazquezblanco
Copy link
Contributor

No description provided.

@antoniovazquezblanco antoniovazquezblanco force-pushed the cwalk branch 2 times, most recently from b13b7a3 to a1916f6 Compare February 2, 2024 12:52
@antoniovazquezblanco
Copy link
Contributor Author

A release was pushed with fixed meson version.

likle/cwalk#42

@antoniovazquezblanco antoniovazquezblanco changed the title cwalk 1.2.7 cwalk 1.2.8 Feb 2, 2024
@antoniovazquezblanco
Copy link
Contributor Author

It seems the default option for default_libraries is shared. See https://mesonbuild.com/Builtin-options.html

For some reason, Visual Studio check script is checking for the presence of the static one... Something wrong on my end?

Thanks!

@neheb
Copy link
Collaborator

neheb commented Feb 9, 2024

ERROR: File 'subprojects/cwalk-1.2.8/cwalk.lib' could not be found

is caused by no functions being exported. This can be fixed with a custom def file.

edit: I see the problem. CMakeLists.txt and meson.build differ. CWK_SHARED must be passed when building as shared.

@antoniovazquezblanco
Copy link
Contributor Author

This is being fixed upstream likle/cwalk#46

@antoniovazquezblanco antoniovazquezblanco force-pushed the cwalk branch 3 times, most recently from 8b061a3 to 77c69b3 Compare May 6, 2024 10:13
@antoniovazquezblanco antoniovazquezblanco changed the title cwalk 1.2.8 cwalk: new package May 6, 2024
@antoniovazquezblanco
Copy link
Contributor Author

Now all tests pass! :D

@antoniovazquezblanco antoniovazquezblanco requested a review from neheb May 6, 2024 10:23
@antoniovazquezblanco
Copy link
Contributor Author

Upstream fix at likle/cwalk#47

@antoniovazquezblanco
Copy link
Contributor Author

From upstream, @likle asks:

I am not verify familiar with meson, doesn't "both" mean it builds shared as well as static?
Wouldn't that set it to CWK_SHARED for the static build done using the both option?

@antoniovazquezblanco
Copy link
Contributor Author

Ping @neheb :)

@neheb neheb merged commit 0e5b837 into mesonbuild:master Jun 25, 2024
9 checks passed
@antoniovazquezblanco
Copy link
Contributor Author

Thanks @neheb!

Do you have an answer for #1387 (comment) ?

How does meson deal with dual builds?

Thanks again!!

@antoniovazquezblanco antoniovazquezblanco deleted the cwalk branch June 25, 2024 18:23
@benoit-pierre
Copy link
Contributor

Meson 1.3.0 has support for dedicated shared/static language arguments to library(…): https://mesonbuild.com/Reference-manual_functions.html#library__lang__shared_args.

@neheb
Copy link
Collaborator

neheb commented Jun 25, 2024

both builds both shared and static. When using in a dependency, the shared is used by default. In wraps around here, typically != static is checked to enable a SHARED macro.

@benoit-pierre
Copy link
Contributor

But the static library will be built with the wrong flags:

project('bothlibs', 'c')

library(
  'both',
  configure_file(configuration: {}, macro_name: 'both', output: 'both.c'),
  c_args: get_option('default_library') != 'static' ? '-DSHARED' : [],
)
▸ meson setup --prefix="$PWD/dist/native" --default-library=both -- build/native
[…]
▸ meson compile -C build/native --ninja-args= -v
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /home/bpierre/tmp/bothlibs/build/native -v
ninja: Entering directory `/home/bpierre/tmp/bothlibs/build/native'
[1/3] ccache cc -Ilibboth.so.p -I. -I../.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -fPIC -DSHARED -MD -MQ libboth.so.p/meson-generated_.._both.c.o -MF libboth.so.p/meson-generated_.._both.c.o.d -o libboth.so.p/meson-generated_.._both.c.o -c both.c
[2/3] rm -f libboth.a && gcc-ar csrDT libboth.a libboth.so.p/meson-generated_.._both.c.o
[3/3] cc  -o libboth.so libboth.so.p/meson-generated_.._both.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,-soname,libboth.so

@benoit-pierre
Copy link
Contributor

IMHO, wraps that need special shared/static arguments should use <lang>_shared_args / <lang>_static_args when available and otherwise error on meson < 1.3.0 when building with --default-library=both.

@neheb
Copy link
Collaborator

neheb commented Jun 25, 2024

Right. It’s usually not an issue with GCC based compilers but not MSVC. The best solution for MSVC currently is to avoid these and use def files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants