Skip to content

libdispatch: Don't use vcenvvars - #43

Merged
qmfrederik merged 1 commit into
mainfrom
fixes/dispatch-use-clang
Aug 12, 2025
Merged

libdispatch: Don't use vcenvvars#43
qmfrederik merged 1 commit into
mainfrom
fixes/dispatch-use-clang

Conversation

@qmfrederik

Copy link
Copy Markdown
Owner

Compiler errors occur when compiling libdispatch using the Visual C++ system headers, such as about memory_order_relaxed not being defined. This appears to be because the Visual C++ system headers don't define this enum or don't define this enum in the same header.

The build system will pick up the Visual C++ system headers if the compiler.runtime and compiler.runtime_version values are set (by virtue of the VCVars generator, which is used implicitly by the CMake generator, see https://github.com/conan-io/conan/blob/9826fbd57f43b847d22d4530dfe40f015f4dc9e5/conan/tools/microsoft/visual.py#L302).

If compiler.runtime and compiler.runtime_version is not set, VCVars will not run, and the Visual C++ system headers are not picked up. Instead, the Clang headers will be used, which define memory_order_relaxed the way libdispatch expects it.

Compiler errors occur when compiling libdispatch using the Visual C++ system headers, such as about `memory_order_relaxed` not being defined.  This appears to be because the Visual C++ system headers don't define this enum or don't define this enum in the same header.

The build system will pick up the Visual C++ system headers if the `compiler.runtime` and `compiler.runtime_version` values are set (by virtue of the `VCVars` generator, which is used implicitly by the CMake generator, see https://github.com/conan-io/conan/blob/9826fbd57f43b847d22d4530dfe40f015f4dc9e5/conan/tools/microsoft/visual.py#L302).

If `compiler.runtime` and `compiler.runtime_version` is not set, `VCVars` will not run, and the Visual C++ system headers are not picked up.  Instead, the Clang headers will be used, which define `memory_order_relaxed` the way libdispatch expects it.
@qmfrederik
qmfrederik force-pushed the fixes/dispatch-use-clang branch from 1f045d0 to 0580e86 Compare August 12, 2025 15:24
@qmfrederik
qmfrederik merged commit 4bdf7a3 into main Aug 12, 2025
7 checks passed
@qmfrederik
qmfrederik deleted the fixes/dispatch-use-clang branch August 12, 2025 15:37
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.

1 participant