* 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
* [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
* 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>
* 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>
* [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
* [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>
* 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>
* 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
* 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>