Skip to content

meson: gate MSVC-isms on argument syntax, not compiler id - #1090

Open
NathanGray-ChurchillNavigation wants to merge 1 commit into
AravisProject:mainfrom
NathanGray-ChurchillNavigation:clang-cl-argument-syntax-gates
Open

meson: gate MSVC-isms on argument syntax, not compiler id#1090
NathanGray-ChurchillNavigation wants to merge 1 commit into
AravisProject:mainfrom
NathanGray-ChurchillNavigation:clang-cl-argument-syntax-gates

Conversation

@NathanGray-ChurchillNavigation

Copy link
Copy Markdown

clang-cl reports cc.get_id() == 'clang-cl', so it falls through both 'msvc' checks in
meson.build:

  • the export define block, so a shared build gets no __declspec(dllexport) and consumers fail to link
  • the libm lookup, so it runs cc.find_library('m', required: true) on Windows, where there is no
    libm - a hard configure failure

cc.get_argument_syntax() returns 'msvc' for both cl and clang-cl and 'gcc' otherwise, so
switching those two gates is a no-op for every configuration that works today.

The two get_id() checks that pick warning flags are left alone - those are genuinely about flag
spellings rather than argument syntax.

clang-cl reports cc.get_id() == 'clang-cl', so it falls through both
'msvc' checks: it loses the __declspec(dllexport) export define, and it
tries to find a libm that does not exist on Windows, which is a hard
failure since the lookup is required.

get_argument_syntax() is 'msvc' for both cl and clang-cl and 'gcc'
otherwise, so this is a no-op for existing configurations.
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