[linux x86] Set -m32 in Linker flags too (#31811)

When cross-compiling for x86 Linux, the -m32 flag must also be passed to the linker otherwise it complains about trying to link code built for the wrong architecture.
This commit is contained in:
Darryl Pogue 2023-06-13 22:36:21 -07:00 committed by GitHub
parent 93b7a0d701
commit 95b51560e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,7 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(CMAKE_SYSTEM_PROCESSOR x86 CACHE STRING "")
string(APPEND VCPKG_C_FLAGS " -m32")
string(APPEND VCPKG_CXX_FLAGS " -m32")
string(APPEND VCPKG_LINKER_FLAGS " -m32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR armv7l CACHE STRING "")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")