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

[vcpkg scripts] Crosscompiling fixes #26617

Merged
merged 55 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
cff0492
test osx stuff
Neumann-A Aug 31, 2022
3f0bf20
deactivate most of ci
Neumann-A Sep 1, 2022
ce3fd60
get trace output
Neumann-A Sep 1, 2022
43553d9
add required flags to the linker flags
Neumann-A Sep 1, 2022
b8f6974
also look for --sysroot
Neumann-A Sep 1, 2022
c411a33
Link_args are always shared
Neumann-A Sep 2, 2022
5578e67
fix ar flags
Neumann-A Sep 2, 2022
ac5c8f9
setup FOR_BUILD vars.
Neumann-A Sep 2, 2022
98e8b82
try tricking the build.... but man configure scripts are stupid somet…
Neumann-A Sep 3, 2022
4b5f803
try 2
Neumann-A Sep 3, 2022
cf7adeb
major meson rewrite
Neumann-A Sep 3, 2022
d905202
fix duplicates
Neumann-A Sep 4, 2022
8c6339f
revert --trace-expand
Neumann-A Sep 4, 2022
6757d04
update port version
Neumann-A Sep 4, 2022
0bc3956
Merge remote-tracking branch 'upstream/master' into fix_cpp_osx_and_o…
Neumann-A Sep 4, 2022
332329f
revert pipeline changes
Neumann-A Sep 4, 2022
8b311a4
v db
Neumann-A Sep 4, 2022
886beb6
bump version
Neumann-A Sep 4, 2022
8ee8423
v db
Neumann-A Sep 4, 2022
002f6ba
set flags for rc compilers
Neumann-A Sep 5, 2022
a5b9bc8
a few more ios fixes.
Neumann-A Sep 6, 2022
133b0a0
v db
Neumann-A Sep 6, 2022
176edfb
fix osx/ios logic
Neumann-A Sep 8, 2022
22564ed
documentation and don't fatal_error in build/host machine entry calcu…
Neumann-A Sep 9, 2022
b4a45aa
Merge branch 'fix_cpp_osx_and_others' of https://github.com/Neumann-A…
Neumann-A Sep 9, 2022
1570c35
add android/compiler target stuff from #26570
Neumann-A Sep 14, 2022
1673027
remove extra endif
Neumann-A Sep 14, 2022
d347f83
Merge branch 'master' of https://github.com/microsoft/vcpkg into fix_…
Sep 16, 2022
357b504
Merge remote-tracking branch 'upstream/master' into fix_cpp_osx_and_o…
Neumann-A Sep 17, 2022
5b30569
v db
Neumann-A Sep 17, 2022
7e4ffa9
add target param to linker flags.
Neumann-A Sep 18, 2022
4acc2d0
target in cpp flags
Neumann-A Sep 18, 2022
005ccbe
Make vcpkg-cmake-get-vars more ios compatible
m-kuhn Sep 18, 2022
ad5ae3b
Merge pull request #10 from opengisch/opengisch/misc-osx-ios-android
Neumann-A Sep 18, 2022
6aca335
Update scripts/get_cmake_vars/CMakeLists.txt
Neumann-A Sep 18, 2022
ceb7bfe
More ios fixes
m-kuhn Sep 18, 2022
af8f8ea
Merge pull request #11 from m-kuhn/moreios
Neumann-A Sep 18, 2022
6f18956
fix target adding
Neumann-A Sep 18, 2022
4b8384e
Merge branch 'fix_cpp_osx_and_others' of https://github.com/Neumann-A…
Neumann-A Sep 18, 2022
21553e5
Fix broken loop
m-kuhn Sep 18, 2022
c144ba1
Merge pull request #12 from m-kuhn/fix_broken_loop
Neumann-A Sep 18, 2022
d902437
v db
Neumann-A Sep 18, 2022
342d37f
Merge branch 'fix_cpp_osx_and_others' of https://github.com/Neumann-A…
Neumann-A Sep 18, 2022
0475e5d
v db
Neumann-A Sep 18, 2022
a333006
Merge remote-tracking branch 'upstream/master' into fix_cpp_osx_and_o…
Neumann-A Sep 26, 2022
051c678
bump date
Neumann-A Sep 26, 2022
e422921
v db
Neumann-A Sep 26, 2022
96b5807
v db
Neumann-A Sep 26, 2022
184abe3
Merge branch 'microsoft:master' into fix_cpp_osx_and_others
Neumann-A Sep 28, 2022
f27f316
Merge branch 'microsoft:master' into fix_cpp_osx_and_others
Neumann-A Oct 1, 2022
999c02e
Merge branch 'microsoft:master' into fix_cpp_osx_and_others
Neumann-A Oct 4, 2022
0bf1edb
Merge remote-tracking branch 'upstream/master' into fix_cpp_osx_and_o…
Neumann-A Oct 9, 2022
7292d87
v db
Neumann-A Oct 9, 2022
6ae069e
remove port-version 1
Neumann-A Oct 9, 2022
29d5b6d
v db
Neumann-A Oct 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/vcpkg-cmake-get-vars/cmake_get_vars/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if(CMAKE_SYSROOT AND CMAKE_CXX_COMPILE_OPTIONS_SYSROOT)
string(APPEND EXTRA_FLAGS " \"${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}\"")
endif()

foreach(flags CXX C SHARED_LINKER EXE_LINKER)
foreach(flags CXX C SHARED_LINKER EXE_LINKER STATIC_LINKER MODULE_LINKER)
set(${flags}_FLAGS "${CMAKE_${flags}_FLAGS} ${CMAKE_${flags}_FLAGS_${VCPKG_CONFIGS}} ${EXTRA_FLAGS}")
endforeach()

Expand Down
84 changes: 42 additions & 42 deletions scripts/azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,54 @@ parameters:
default: 'use default'

jobs:
- template: windows/azure-pipelines.yml
parameters:
triplet: x86-windows
jobName: x86_windows
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: x86-windows
# jobName: x86_windows
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-windows
jobName: x64_windows
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: x64-windows
# jobName: x64_windows
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-windows-static
jobName: x64_windows_static
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: x64-windows-static
# jobName: x64_windows_static
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-windows-static-md
jobName: x64_windows_static_md
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: x64-windows-static-md
# jobName: x64_windows_static_md
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-uwp
jobName: x64_uwp
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: x64-uwp
# jobName: x64_uwp
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: arm64-windows
jobName: arm64_windows
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: arm64-windows
# jobName: arm64_windows
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: arm-uwp
jobName: arm_uwp
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
#- template: windows/azure-pipelines.yml
# parameters:
# triplet: arm-uwp
# jobName: arm_uwp
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: osx/azure-pipelines.yml
parameters:
Expand Down
6 changes: 3 additions & 3 deletions scripts/cmake/vcpkg_configure_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ macro(z_vcpkg_determine_autotools_target_arch_mac out_var)
endmacro()

macro(z_vcpkg_extract_cpp_flags_and_set_cflags_and_cxxflags flag_suffix)
string(REGEX MATCHALL "( |^)-D[^ ]+" CPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${flag_suffix}}")
string(REGEX MATCHALL "( |^)-D[^ ]+" CXXPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${flag_suffix}}")
string(REGEX MATCHALL "( |^)(-D|-isysroot|-isystem|-m?[Aa][Rr][Cc][Hh]) ?[^ ]+" CPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_C_FLAGS_${flag_suffix}}")
string(REGEX MATCHALL "( |^)(-D|-isysroot|-isystem|-m?[Aa][Rr][Cc][Hh]) ?[^ ]+" CXXPPFLAGS_${flag_suffix} "${VCPKG_DETECTED_CMAKE_CXX_FLAGS_${flag_suffix}}")
list(JOIN CXXPPFLAGS_${flag_suffix} "|" CXXREGEX)
if(CXXREGEX)
list(FILTER CPPFLAGS_${flag_suffix} INCLUDE REGEX "(${CXXREGEX})")
Expand Down Expand Up @@ -384,7 +384,7 @@ function(vcpkg_configure_make)
# Currently needed for arm because objdump yields: "unrecognised machine type (0x1c4) in Import Library Format archive"
list(APPEND arg_OPTIONS lt_cv_deplibs_check_method=pass_all)
endif()
elseif(NOT VCPKG_TARGET_IS_OSX)
else()
# Because OSX dosn't like CMAKE_C(XX)_COMPILER (cc) in CC/CXX and rather wants to have gcc/g++
function(z_vcpkg_make_set_env envvar cmakevar)
set(prog "${VCPKG_DETECTED_CMAKE_${cmakevar}} ${ARGN}")
Expand Down
11 changes: 0 additions & 11 deletions scripts/cmake/vcpkg_configure_meson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ function(z_vcpkg_meson_generate_flags_properties_string out_var config_type)
set(linker_flags "${VCPKG_DETECTED_CMAKE_STATIC_LINKER_FLAGS_${config_type}}")
endif()
z_vcpkg_meson_convert_compiler_flags_to_list(linker_flags "${linker_flags}")
if(VCPKG_TARGET_IS_OSX)
# macOS - append arch and isysroot if cross-compiling
if(NOT "${VCPKG_OSX_ARCHITECTURES}" STREQUAL "${VCPKG_DETECTED_CMAKE_HOST_SYSTEM_PROCESSOR}")
foreach(arch IN LISTS VCPKG_OSX_ARCHITECTURES)
vcpkg_list(APPEND linker_flags -arch "${arch}")
endforeach()
endif()
if(VCPKG_DETECTED_CMAKE_OSX_SYSROOT)
vcpkg_list(APPEND linker_flags -isysroot "${VCPKG_DETECTED_CMAKE_OSX_SYSROOT}")
endif()
endif()
vcpkg_list(APPEND linker_flags "${libpath}")
z_vcpkg_meson_convert_list_to_python_array(linker_flags ${linker_flags})
string(APPEND result "c_link_args = ${linker_flags}\n")
Expand Down
1 change: 1 addition & 0 deletions scripts/cmake/z_vcpkg_get_cmake_vars.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function(z_vcpkg_get_cmake_vars out_file)
CACHE PATH "The file to include to access the CMake variables from a generated project.")
vcpkg_configure_cmake(
SOURCE_PATH "${SCRIPTS}/get_cmake_vars"
OPTIONS --trace-expand
OPTIONS_DEBUG "-DVCPKG_OUTPUT_FILE:PATH=${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}-dbg.cmake.log"
OPTIONS_RELEASE "-DVCPKG_OUTPUT_FILE:PATH=${CURRENT_BUILDTREES_DIR}/cmake-vars-${TARGET_TRIPLET}-rel.cmake.log"
PREFER_NINJA
Expand Down
6 changes: 3 additions & 3 deletions scripts/get_cmake_vars/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ list(APPEND VCPKG_DEFAULT_ENV_VARS_TO_CHECK PATH INCLUDE C_INCLUDE_PATH CPLUS_IN
list(REMOVE_DUPLICATES VCPKG_DEFAULT_ENV_VARS_TO_CHECK)

#Flags to check. Flags are a bit special since they are configuration aware.
set(FLAGS ${VCPKG_LANGUAGES} RC SHARED_LINKER STATIC_LINKER EXE_LINKER)
set(FLAGS ${VCPKG_LANGUAGES} RC SHARED_LINKER STATIC_LINKER EXE_LINKER MODULE_LINKER)
foreach(flag IN LISTS FLAGS)
list(APPEND VCPKG_DEFAULT_FLAGS_TO_CHECK CMAKE_${flag}_FLAGS)
endforeach()
Expand Down Expand Up @@ -98,7 +98,8 @@ macro(_vcpkg_adjust_flags flag_var)
endif()
endif()
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(APPLE)
list(APPEND VCPKG_LANG_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS)
if("${flag_var}" IN_LIST VCPKG_LANG_FLAGS)
# macOS - append arch and isysroot if cross-compiling
if(NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}")
Expand Down Expand Up @@ -129,7 +130,6 @@ foreach(flag IN LISTS VCPKG_FLAGS_TO_CHECK)
endforeach()
endforeach()


file(WRITE "${VCPKG_OUTPUT_FILE}" "${OUTPUT_STRING}")

# Programs:
Expand Down