From b8ae17a5ab665719f2399859caf2c7c7051b4364 Mon Sep 17 00:00:00 2001 From: 51DCI Date: Thu, 18 May 2023 11:51:13 +0100 Subject: [PATCH 1/2] BUILD: Set the VS build platform in CMake if the 32bit flag is set. --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35e25f1c..9bdf7851 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,10 +53,14 @@ option(MemoryOnly "MemoryOnly" OFF) option(NoThreading "NoThreading" OFF) option(ExceptionsDisabled "ExceptionsDisabled" OFF) -if (32bit AND NOT MSVC AND NOT IS_ARM) +if (32bit AND NOT IS_ARM) message("-- 32 bit compilation") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") + if (NOT MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") + else() + set(CMAKE_VS_PLATFORM_NAME "Win32") + endif() endif() if (NOT MSVC AND NOT APPLE) From e4834f7218c3cd6b7adb1188a72a26298d61c01f Mon Sep 17 00:00:00 2001 From: Ben51Degrees Date: Thu, 18 May 2023 13:50:02 +0100 Subject: [PATCH 2/2] BUILD: If running CI for Linux, then install multilib. This is required when building for architectures other than the system one. --- ci/setup-environment.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci/setup-environment.ps1 b/ci/setup-environment.ps1 index b1b7031a..5e90b3bd 100644 --- a/ci/setup-environment.ps1 +++ b/ci/setup-environment.ps1 @@ -12,3 +12,10 @@ if ($BuildMethod -eq "msbuild") { ./environments/setup-msbuild.ps1 } + +if ($IsLinux) { + + # Install multilib, as this may be required. + sudo apt-get install -y gcc-multilib + +}