Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/newsfragments/398.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MSVC Cap'n Proto builds force-include a guard that undefines ``interface`` after ``project()``, so Meson 1.12's ``cl.exe`` sanity check no longer sees ``/FID:/...``.
12 changes: 12 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@ project(

host_system = host_machine.system()

# MSVC: Cap'n Proto templates break when windows.h defines `interface`.
# Force-include the guard after compiler detection. A /FI path in CXXFLAGS
# is applied to Meson's cl.exe sanity check; a drive-letter path becomes
# /FID:/... and Meson reports that cl.exe cannot compile programs.
if host_system == 'windows' and meson.get_compiler('cpp').get_id() == 'msvc'
add_project_arguments(
'/FI',
meson.current_source_dir() / 'msvc_capnp_guard.h',
language: 'cpp',
)
endif

_args = [] # Extra arguments
_fargs = [] # Fortran arguments
_deps = [] # Dependencies
Expand Down
7 changes: 7 additions & 0 deletions msvc_capnp_guard.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifdef interface
#undef interface
#endif
Loading