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

CMake subproject ignores dependent libraries #10984

Open
eyelash opened this issue Nov 2, 2022 · 0 comments · May be fixed by #12019
Open

CMake subproject ignores dependent libraries #10984

eyelash opened this issue Nov 2, 2022 · 0 comments · May be fixed by #12019

Comments

@eyelash
Copy link

eyelash commented Nov 2, 2022

Describe the bug
If I load a CMake project as a subproject and that CMake project contains multiple libraries that depend on each other, Meson will only compile one of the libraries and ignore the other one.

FAILED: main 
c++  -o main main.p/main.cc.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group subprojects/liba/liblibc.a -Wl,--end-group
/usr/bin/ld: subprojects/liba/liblibc.a.p/libc_src_libc.cc.o: in function `c()':
/home/elias/meson-cmake-test/_build/../subprojects/liba/libc/src/libc.cc:5: undefined reference to `b()'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

To Reproduce
meson-cmake-test.zip
The project contains two identical main files. One of those is only there to prove that the CMake project works on its own.

Expected behavior
I expect the project to build without errors.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?
    plain native build
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
    Arch Linux
  • what Python version are you using e.g. 3.8.0
    Python 3.10.8
  • what meson --version
    0.63.3
  • what ninja --version if it's a Ninja build
    1.11.1
@eyelash eyelash changed the title CMake support ignores dependent libraries CMake subproject ignores dependent libraries Nov 3, 2022
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 a pull request may close this issue.

1 participant