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] Generator expression test during configure doesn't work. #13214

Open
kasper93 opened this issue May 15, 2024 · 0 comments
Open

[cmake] Generator expression test during configure doesn't work. #13214

kasper93 opened this issue May 15, 2024 · 0 comments

Comments

@kasper93
Copy link
Contributor

Describe the bug
Building https://github.com/google/shaderc doesn't work because there are issues with install support in meson. But I don't need install, so I disabled it. Unfortunately this doesn't work too.

To Reproduce
Try to disable glslang install while building shaderc. Example wrap (source)

project('shaderc', 'cpp', version: '2024.1')

python = find_program('python3')
run_command(python, '../shaderc_cmake/utils/git-sync-deps', check: true)

cmake = import('cmake')
opts = cmake.subproject_options()
opts.add_cmake_defines({
    'CMAKE_MSVC_RUNTIME_LIBRARY': 'MultiThreaded',
    'CMAKE_POLICY_DEFAULT_CMP0091': 'NEW',
    'SHADERC_SKIP_INSTALL': 'ON',
    'SHADERC_SKIP_TESTS': 'ON',
    'SHADERC_SKIP_EXAMPLES': 'ON',
    'SHADERC_SKIP_COPYRIGHT_CHECK': 'ON'
})
shaderc_proj = cmake.subproject('shaderc_cmake', options: opts)
shaderc_dep = declare_dependency(dependencies: [
    shaderc_proj.dependency('shaderc'),
    shaderc_proj.dependency('shaderc_util'),
    shaderc_proj.dependency('SPIRV'),
    shaderc_proj.dependency('SPIRV-Tools-static'),
    shaderc_proj.dependency('SPIRV-Tools-opt'),
    shaderc_proj.dependency('glslang'),
    shaderc_proj.dependency('GenericCodeGen'),
    shaderc_proj.dependency('MachineIndependent'),
])
meson.override_dependency('shaderc', shaderc_dep)

The issue is simple, for this expression, when SKIP_GLSLANG_INSTALL is set to ON.
set(GLSLANG_ENABLE_INSTALL $<NOT:${SKIP_GLSLANG_INSTALL}>)

The following expression will evaluate truthfully, while it shouldn't.
if (GLSLANG_ENABLE_INSTALL)

I've sent workaround to shaderc google/shaderc#1415 but not sure they will want to workaround meson issues, although it is small change.

Expected behavior
It works.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?
  • Windows 11
  • Python 3.12
  • meson 1.4
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

No branches or pull requests

1 participant