Skip to content

Commit a76e464

Browse files
committed
fix: fix windows x86 cross-compilation
1 parent 9f4463b commit a76e464

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,16 @@ if(APPLE)
4949
set(CMAKE_OSX_DEPLOYMENT_TARGET ${MACOSX_DEPLOYMENT_TARGET})
5050
endif()
5151

52-
# Set the target system on Windows (for cross-compiling x86)
52+
# target system on Windows (for cross-compiling x86) and static linking runtimes
5353
if(WIN32)
54-
if("${PLATFORM}" STREQUAL "x86")
54+
if("$ENV{Platform}" STREQUAL "x86")
5555
set(CMAKE_SYSTEM_PROCESSOR "x86")
56-
set(CMAKE_SYSTEM_HOST_PROCESSOR "x86")
57-
# static linking for vcpkg
5856
set(VCPKG_TARGET_TRIPLET "x86-windows-static")
5957
elseif(NOT "$ENV{PROCESSOR_ARCHITEW6432}" STREQUAL "")
6058
set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
61-
set(CMAKE_SYSTEM_HOST_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
62-
# static linking for vcpkg
6359
set(VCPKG_TARGET_TRIPLET "x86-windows-static")
6460
else()
6561
set(CMAKE_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
66-
set(CMAKE_SYSTEM_HOST_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
67-
# static linking for vcpkg
6862
set(VCPKG_TARGET_TRIPLET "x64-windows-static")
6963
endif()
7064
# Avoid loading of project_optinos/WindowsToolchain

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,6 @@
113113
"bump": "pnpx npm-check-updates -u -x typescript,eslint,chai && pnpx typesync && pnpm update"
114114
},
115115
"cmake-ts": {
116-
"globalCMakeOptions": [
117-
{
118-
"name": "CMAKE_EXPORT_COMPILE_COMMANDS",
119-
"value": "1"
120-
}
121-
],
122116
"nodeAPI": "node-addon-api",
123117
"configurations": [
124118
{

0 commit comments

Comments
 (0)