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

meson builds fail on OS X with clang due to Windows / MSVC-specific C(XX)FLAGS #7150

Closed
tobbi opened this issue Jul 3, 2019 · 2 comments
Closed
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@tobbi
Copy link
Contributor

tobbi commented Jul 3, 2019

When I try to install e.g. libepoxy using vcpkg on OS X, I get the following output from meson:

Build started at 2019-07-03T21:39:54.767048
Main binary: /usr/local/opt/python/bin/python3.7
Python system: Darwin
The Meson build system
Version: 0.51.0
Source dir: vcpkg/buildtrees/libepoxy/src/1.5.3-d7b9d32fcb
Build dir: vcpkg/buildtrees/libepoxy/x64-osx-rel
Build type: native build
WARNING: Unknown options: "enable-egl, enable-glx"
Project name: libepoxy
Project version: 1.5.3
Appending CFLAGS from environment: ' /DWIN32 /D_WINDOWS /W3 /utf-8  /MD /O2 /Oi /Gy /DNDEBUG /Z7'
Appending LDFLAGS from environment: ' /DEBUG  /INCREMENTAL:NO /OPT:REF /OPT:ICF'
Appending CPPFLAGS from environment: ' '
Sanity testing C compiler: cc
Is cross compiler: False.
Sanity check compiler command line: cc /DWIN32 /D_WINDOWS /W3 /utf-8 /MD /O2 /Oi /Gy /DNDEBUG /Z7 /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF vcpkg/buildtrees/libepoxy/x64-osx-rel/meson-private/sanitycheckc.c -o vcpkg/buildtrees/libepoxy/x64-osx-rel/meson-private/sanitycheckc.exe
Sanity check compile stdout:

-----
Sanity check compile stderr:
clang: error: no such file or directory: '/DWIN32'
clang: error: no such file or directory: '/D_WINDOWS'
clang: error: no such file or directory: '/W3'
clang: error: no such file or directory: '/utf-8'
clang: error: no such file or directory: '/MD'
clang: error: no such file or directory: '/O2'
clang: error: no such file or directory: '/Oi'
clang: error: no such file or directory: '/Gy'
clang: error: no such file or directory: '/DNDEBUG'
clang: error: no such file or directory: '/Z7'
clang: error: no such file or directory: '/DEBUG'
clang: error: no such file or directory: '/INCREMENTAL:NO'
clang: error: no such file or directory: '/OPT:REF'
clang: error: no such file or directory: '/OPT:ICF'

-----

meson.build:1:0: ERROR: Compiler cc can not compile programs.

The problem seems to be that clang is unable to understand those flags.

@vicroms vicroms added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Jul 3, 2019
@vicroms
Copy link
Member

vicroms commented Jul 3, 2019

The problem lies in the code of vcpkg_configure_meson(), all of these flags are being hardcoded and passed to meson regardless of platform or triplet. The code should be changed to resemble vcpkg_configure_cmake() and take C_FLAGS and CXX_FLAGS from the appropriate toolchain file.

fungos added a commit to fungos/vcpkg that referenced this issue Nov 30, 2019
- Fixes microsoft#7412 by using gtk 3.24.10.

- Possibly fixes microsoft#6554, microsoft#7827, microsoft#8103 as now all the missing assets are
correctly copied into installed/<triplet>/share/ and should be deployed
with the final application.

This simplify the gtk port and correctly generate the missing files.

The source of the problem is with the underlying build system, as these
files were installed by the demo `icon-browser`, but the
gtk-update-icon-cache were executed by the main gtk project, failing if
the demo wasn't built or installed.

- This also fixes microsoft#7641 as now the meson build will correctly generate
the missing .pc files.

- This also fixes microsoft#9035, microsoft#7150 by fixing `vcpkg_configure_meson.cmake`
which fails on Linux/OSX because it indiscriminately try to pass msvc
cl arguments to the cmake c/xx flags. Although this works, it is not
the ideal fix. The correct fix would be to do as suggested in
issue microsoft#8271. Also see issue microsoft#8630.
@Neumann-A
Copy link
Contributor

@JackBoosY close since vcpkg_configure_meson has been changed to obey the flags cmake uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

No branches or pull requests

5 participants
@tobbi @vicroms @Neumann-A @JackBoosY and others