Commit Graph

13 Commits

Author SHA1 Message Date
Frederik Carlier
ba58a3fdf2
[glib] Support cross-compiling Objective C code using Meson (#33313)
* Support cross-compiling Objective C code using Meson

The glib port uses Objective C code and the Meson build system.
You'll end up cross compiling glib when compiling for x64 osx
on an arm64 osx machine, or vice versa.

For this to work, an Objective C compiler needs to be set
in the Meson cross file.

vcpkg generates this file based on the
`scripts/buildsystems/meson/meson.template.in` template, and expects
the `MESON_OBJC` CMake variable to be set.

That's the job of `z_vcpkg_meson_set_proglist_variables` in
`scripts/cmake/vcpkg_configure_meson.cmake`.  It will only generate data
for an Objective C compiler if:

- The `Languages` argument includes `OBJC`
- CMake has detected a Objective C compiler, and has set `VCPKG_DETECTED_CMAKE_OBJC_COMPILER`

To make this work, this patch:
- Enables the OBJC and OBJCXX language on Apple platforms
- Updates the call to `vcpkg_configure_meson` in the glib port file
  to include the OBJC OBJCXX languages.

Fixes https://github.com/microsoft/vcpkg/issues/26147
Fixes https://github.com/microsoft/vcpkg/issues/20341
Based on https://github.com/microsoft/vcpkg/pull/26259
Based on 27dee354e4

Tested on an arm64 mac to compile glib for x64 macos

* Update version database
2023-08-25 12:25:28 -07:00
Kai Pastor
73b9a2a359
[openssl,vcpkg-cmake-get-vars] Fix android and emscripten, add feature tools (#29966)
* [vcpkg-cmake-get-vars] Call 'project' early

System variables like 'APPLE' or 'ANDROID' aren't set before 'project()'.

* Get Android variables

* [openssl] Ensure that compiler is reached via 'PATH'

* Fix Android configuration

* Add 'tools' feature

* Update versions

* [openssl] Initialize android with vcpkg settings

* [openssl] Really don't build apps

* [vcpkg-cmake-get-vars] Update android vars

* [libpq] Pass openssl version from pkgconfig

* [vcpkg-cmake-get-vars] Update android vars

* [vcpkg-cmake-get-vars] Report generator

* [vcpkg-cmake-get-vars] Escape all output

* Transfer cmake-get-vars fixes

* Transfer cmake-get-vars extra flags

* no-asm for android-arm w/o neon

* [vcpkg_configure_make] Unquote as needed

Toolchain flags are passed into make via environment variables (e.g.
CFLAGS) and expanded by Makefiles regardless of quotes. And even vcm's
internal handling isn't prepared for these quotes. So we must remove
the early. This doesn't interfere with properly escaped quotes.

* Re-add lost 'project', amends 4cf7caaa

* [openssl] Fix emscripten
2023-03-14 14:11:06 -07:00
Alexander Neumann
45e66bff9b
[scripts|vcpkg_configure_make] Help C(XX)FLAGS survive through libtool (#28349)
* help cflags survive through libtool

* Guard -Xcompiler in case of gcc/gnu

since it doesn't like unknown compiler flags.

* export CMAKE_<lang>_COMPILER_FRONTEND_VARIANT from cmake

* v db and script changes

* also check compiler id

Co-authored-by: Cheney-Wang <850426846@qq.com>
2023-01-07 01:04:32 -08:00
Alexander Neumann
d8e60ef474
[vcpkg scripts] Crosscompiling fixes (#26617)
* test osx stuff

* deactivate most of ci

* get trace output

* add required flags to the linker flags

* also look for --sysroot

* Link_args are always shared

* fix ar flags

* setup FOR_BUILD vars.

* try tricking the build.... but man configure scripts are stupid sometimes...

* try 2

* major meson rewrite

* fix duplicates

* revert --trace-expand

* update port version

* revert pipeline changes

* v db

* bump version

* v db

* set flags for rc compilers

* a few more ios fixes.

* v db

* fix osx/ios logic

* documentation and don't fatal_error in build/host machine entry calculation.

* add android/compiler target stuff from #26570

* remove extra endif

* v db

* add target param to linker flags.

* target in cpp flags

* Make vcpkg-cmake-get-vars more ios compatible

* Update scripts/get_cmake_vars/CMakeLists.txt

Co-authored-by: Matthias Kuhn <matthias@opengis.ch>

* More ios fixes

* fix target adding

* Fix broken loop

* v db

* v db

* bump date

* v db

* v db

* v db

* remove port-version 1

* v db

Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Co-authored-by: Matthias Kuhn <matthias@opengis.ch>
2022-10-13 09:40:52 -07:00
Alexander Neumann
05c93c5c5a
[Fix uwp toolchain|world rebuild] make ninja work for uwp (#22831) 2022-04-27 18:12:48 -07:00
Daniel Schürmann
a34997af6c
[vcpkg] Meson osx sysroot (#21772)
* [get_cmake_vars] add -isysroot flag independednt of crosscompiling

Even without crosscompiling it is possible to specify a VCPKG_OSX_SYSROOT or
a SDKROOT this should be popagated to autotools and meson builds as well.

* [meson] add -arch and -isysroot to linker flags in case of osx crosscompile

* [meson] avoid DEPRECATION warning about flags in the [properties] section

* [meson] don't set OSXROOT evironment varibale

* [meson] don't set MACOSX_DEPLOYMENT_TARGET environment variable

cmake appends the -mmacosx-version-min flag c/cxx flags, overriding the
value set via VCPKG_C_FLAGS. By setting the environment variable, the
VCPKG_C_FLAGS value was used for meson builds. Now the same value is
taken for both.

* [meson/make] Add CMAKE_OSX_DEPLOYMENT_TARGET to VCPKG_DETECTED_CMAKE_C_FLAGS

This is done in the same way in CMake internally
2022-02-24 11:04:11 -08:00
autoantwort
c24f57e9fc
[meson] fix cross compiling from linux to windows (#18927)
* [meson] fix cross compiling from linux to windows

* Fix mingw system name

* Omit empty fields from standard libraries

* Use VCPKG_CROSSCOMPILING

* vcpkg_configure_meson: do not double escape include paths

* vcpkg_configure_meson: set winres instead of rc

* vcpkg_configure_meson: do not always cross build

* Apply suggestions from code review

* fix the issue I made

* [meson] error when gcc uses a different linker executeable

* [meson] apply code review from strega-nil

* [meson] more verbose error messages

* [meson] remove wrong check

Co-authored-by: Kai Pastor <dg0yt@darc.de>
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
2021-09-09 20:41:01 -07:00
nicole mazzuca
99e06a64ec
[rollup:2021-08-09] Rollup PR (#19469)
* [rollup:2021-08-09] PR #16706 (@JackBoosY)

[vcpkg_fixup_cmake_targets] Fix up OSX system development path

* [rollup:2021-08-09] PR #19238 (@strega-nil)

[scripts-audit] vcpkg_download_distfile

* [rollup:2021-08-09] PR #19239 (@strega-nil)

[scripts-audit] vcpkg_find_fortran

* [rollup:2021-08-09] PR #19338 (@strega-nil)

[tinyfiledialogs] Fix for good

* [rollup:2021-08-09] PR #19348 (@strega-nil)

[scripts-audit] vcpkg_fixup_pkgconfig

* fix ports.cmake with newer vcpkg_download_distfile

* fix vcpkg create

* move vcpkg_common_definitions down so that it's not incorrect

* fix vcpkg_internal_get_cmake_vars

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
2021-08-16 13:42:31 -07:00
nicole mazzuca
d369df7ecf
[rollup:2021-07-06] Rollup PR (#18838)
* [rollup:2021-07-06 1/8] PR #18272 (@strega-nil)

[scripts-audit] vcpkg_from_*

* [rollup:2021-07-06 2/8] PR #18319 (@strega-nil)

[scripts-audit] add guidelines for cmake

* [rollup 2021-07-06 3/8] PR #18410 (@mheyman)

[vcpkg-cmake-config] documentation fix

* [rollup:2021-07-06 4/8] PR #18488 (@strega-nil)

[scripts-audit] vcpkg_execute_*

* [rollup:2021-07-06 5/8] PR #18517 (@strega-nil)

[scripts-audit] vcpkg_extract_source_archive

* [rollup:2021-07-06 6/8] PR #18674 (@NancyLi1013)

[vcpkg doc] Update examples

* [rollup:2021-07-06 7/8] PR #18695 (@JackBoosY)

[vcpkg] Update the minimum version of vcpkg

* [rollup:2021-07-06 8/8] PR #18758 (@ras0219-msft)

[vcpkg_from_git] Fix error if downloads folder does not exist

* build docs!

* fix bond:*-windows

* fix nmap

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Co-authored-by: Michael Heyman <Michael.Heyman@jhuapl.edu>
Co-authored-by: NancyLi1013 <lirui09@beyondsoft.com>
Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
Co-authored-by: Robert Schumacher <ras0219@outlook.com>
2021-07-14 12:45:18 -07:00
huangqinjin
2e35636a96
[vcpkg] Convert env vars slash if host is Win32 (#16927) 2021-04-07 13:17:04 -07:00
pastdue
7115ef469d
vcpkg_configure_make: Support macOS cross-compile (#15659)
* vcpkg_configure_make: Support macOS cross-compile

* Move compiler flags logic to get_cmake_vars

* Better match the arch behavior of config.guess

* Apply suggestions from code review

Co-authored-by: Billy O'Neal <bion@microsoft.com>

Co-authored-by: Billy O'Neal <bion@microsoft.com>
2021-01-28 19:38:32 -08:00
Alexander Neumann
3217e25596
[meson|scripts] update scripts (#12945)
* Update meson to a recent commit to fix a bug with 0.56

* rename static libraries built by meson by default on windows

* apply cmake variables detection to meson.
use native/cross files
make arm builds work.

* update munit

* fix fribidi

* fix _FLAGS variables

* set env SDKROOT and MACOSX_DEPLOYMENT_TARGET in configure_meson

* need osx env while building and configuring

* - remove unused env backup functions
- rename internal functions to be prefixed with _vcpkg_
- fix VCPKG_CHAINLOAD_TOOLCHAIN_FILE for ios/freebsd

* replace _vcpkg with vcpkg since _ has special meaning in functions

* rename functions to vcpkg_internal_meson_generate

* update control tool-meson
2020-11-18 13:36:20 -08:00
Alexander Neumann
8de4ee858f
[vcpkg/scripts] Add a way to get cmake compiler settings/flags (#12936)
* add function get_cmake_vars

* fine tuning.

* apply to make based ports.

* add log suffix on not windows platforms

* fix c&p error

* add previous LINK env

* setup env on windows and extract cpp flags correctly.

* Apply suggestions from code review

* commit changes from fontconfig PR

* Apply suggestions from code review

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>

* cleanup docs

* add conversion from somelib.lib to -lsomelib

* add missing ar-lib wrapper

* small but important regex correction

* add latest changes from update_fontconfig PR

* Apply suggestions from code review

first set which don't need special attention

Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>

* Apply suggestions from code review

one more simple change

Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>

* [x264] set env AS

* fix bugs due to refactor

* use subpath everywhere

* apply changes from CR

* remove unnecessary lines 41 & 44

* remove flag transformation

* reintroduce the flag / to - transformation for MSVC

* Apply suggestions from code review

Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>

* rename the function

* rename function/variables

* transform flags list

* Apply suggestions from code review

* fix vcpkg_build_make due to the variable name change

* fix another case of function renaming regressions

* only rename config.log if it exists

* actually add the script after vcpkg_common_functions was deleted.

* remove setting of ldflags if path contains spaces

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Co-authored-by: ras0219 <533828+ras0219@users.noreply.github.com>
2020-11-10 09:52:02 -08:00