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

GLFW release compilation fails on locked .pdb file (vs backend) - meson only #14118

Open
ligazetom opened this issue Jan 11, 2025 · 1 comment
Labels
bug module:cmake Issues related to the cmake module, including cmake.subproject

Comments

@ligazetom
Copy link

Describe the bug
When trying to compile project with glfw library, no matter if static or shared, in release configuration it will always end up with error: error C1041: cannot open program database *path* if multiple CL.EXE write to the same .PDB file, please use /FS. This obviously breaks the build and that's it. I've played around in VS22 IDE trying to change settings and the cause was/is Debug Information Format. If it's set to None the build breaks. But if it's set to anything else it's ok.

I've tried to build the same config through regular cmake without meson and it works just fine no matter the option.

The only way I've been able to build it with meson is by passing --debug option to meson setup command (or configure), which will set the mentioned setting to Program database \Zi which is what I tried manually at first and it started working. I would be very suspicious of glfw itself but since cmake had no issue I'm not so sure anymore.

I haven't been able to figure out WHY, but I'm hoping this will lead someone else to the real solution.

To Reproduce
Simple meson

project('proj',
        'cpp',
        meson_version : '>=1.1',
        version : '0.0.1',
        default_options : ['cpp_std=c++20', 'default_library=static'])

cmake = import('cmake')
glfw_proj = cmake.subproject('glfw')
deps = [glfw_proj.dependency('glfw')]

executable('Proj', ['main.cpp'], win_subsystem : 'console', dependencies: deps)

with wrap file glfw.wrap in subprojects folder

[wrap-git]
url = https://github.com/glfw/glfw
revision = 3.4
depth = 1

And regular empty main function returning 0.

Then just simple meson setup . vsbuild --backend=vs --buildtype=release followed by meson compile -C vsbuild -j 16. Those are my exact commands. Altering the first one like this: meson setup . vsbuild --backend=vs --buildtype=release --debug solves the issue.

I've tested it with vs and ninja and unfortunately it happens only with vs backend, but I have to use it as I'm using c++20 modules and ninja is not able to handle them (yet).

Expected behavior
In debug mode or with .pdb generation allowed it works fine. I would expect the same behavior in release as well.

system parameters
Native build
Windows 10
3.12
1.6.1

@dcbaker dcbaker added bug module:cmake Issues related to the cmake module, including cmake.subproject labels Jan 11, 2025
@ligazetom
Copy link
Author

Just wanted to add that the same thing happens in debug build as well. Debug Information Format is deciding if it works or not. If it's set to None then no build is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug module:cmake Issues related to the cmake module, including cmake.subproject
Projects
None yet
Development

No branches or pull requests

2 participants