[vcpkg/meson] fix some details#15756
Conversation
deactivate native compiler in cross builds make x86 on x86_x64 a native instead of a cross build (as long as we are not building for UWP)
remove unnecessary comments
|
@ras0219 @ras0219-msft Ping for reivew again. |
|
@Neumann-A playing around with this PR as I'm trying to get the glib port working on Android. It looks like some of the options in the internal meson cross file are getting generated with some spaces inbetween some of the dashes, e.g.: Leading to this error during configure: |
|
Ping @Neumann-A @ras0219 for review again. |
# Conflicts: # scripts/cmake/vcpkg_install_meson.cmake
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
ras0219-msft
left a comment
There was a problem hiding this comment.
Looks good so far; still needs merge from master due to @post-due's fixes
# Conflicts: # scripts/cmake/vcpkg_configure_meson.cmake
|
@ras0219 Sry, I think you have to re-review. I changed quite a bit in the merge since I was sick of the amount of duplication in the flags code. There is still quite a bit of duplication and I think that maybe the native and cross generators could be merged a bit more in a future PR. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Due to my lack of meson knowledge, I prefer @ras0219 @ras0219-msft to review this PR again. |
# Conflicts: # scripts/cmake/vcpkg_configure_meson.cmake
|
Ping @ras0219 @ras0219-msft for review this PR again. |
ras0219-msft
left a comment
There was a problem hiding this comment.
This generally LGTM. I'll wait to merge until after you've replied to my comments.
| list(TRANSFORM FLAG_LIST APPEND "'") | ||
| list(TRANSFORM FLAG_LIST PREPEND "'") | ||
| list(JOIN FLAG_LIST ", " ${_out_var}) | ||
| string(REPLACE "'', " "" ${_out_var} "${${_out_var}}") # remove empty elements if any |
There was a problem hiding this comment.
This won't remove a single empty element.
It might be easier to construct this list using string(APPEND) and a foreach loop.
There was a problem hiding this comment.
This won't remove a single empty element.
It will remove empty strings "". It should be noted here that the elements are already whitespace striped because otherwise meson will pass them wrongly to the tool invocation.
It might be easier to construct this list using string(APPEND) and a foreach loop.
Yeah I also thought about that but did not want to deal with strange corner cases if there are elements containing ;. So I thought list(TRANSFORM) is a saver approach
| string(APPEND CROSS "cpu = '${BUILD_CPU}'\n") | ||
|
|
||
| if(NOT BUILD_CPU_FAM STREQUAL HOST_CPU_FAM OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS) | ||
| if(NOT BUILD_CPU_FAM MATCHES "${HOST_CPU_FAM}" OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_IOS) |
There was a problem hiding this comment.
Why the change to MATCHES? It seems like STREQUAL would be better (don't want arm matching arm64)
There was a problem hiding this comment.
It is the other way around.
BUILD = arm64 | x64_x86
HOST = arm | x86
arm64 matches arm but not the other way around
the same for x64_x86 which matches x86 but not the other way.
There was a problem hiding this comment.
Also if VCPKG_CROSSCOMPILING is a thing now I could use it here.
There was a problem hiding this comment.
In that case we should just use TARGET_TRIPLET STREQUAL HOST_TRIPLET
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
changes extracted from #13100