@@ -14,7 +14,6 @@ fail() {
1414
1515root_dir=$( cd ` dirname $0 ` /.. && pwd -P)
1616package_dir=" $root_dir /package.nw"
17- export PATH=" $root_dir /node/bin:$PATH "
1817
1918if [ ! -z $1 ]; then
2019 NW_VERSION=$1
@@ -44,7 +43,7 @@ arch=$(node "$root_dir/tools/parse-config.js" --get-arch $@)
4443
4544if [ " $arch " == " loong64" ]; then
4645 notice " 龙架构,准备交叉编译"
47- export PATH=" $root_dir /cache/cross-tools/target/usr/bin:$root_dir /node/bin: $root_dir / cache/cross-tools/loongarch64-unknown-linux-gnu/bin:$root_dir /cache/cross-tools/bin:$PATH "
46+ export PATH=" $root_dir /cache/cross-tools/target/usr/bin:$root_dir /cache/cross-tools/loongarch64-unknown-linux-gnu/bin:$root_dir /cache/cross-tools/bin:$PATH "
4847 tools/cross-loong64-prepare.sh
4948 export CC=loongarch64-unknown-linux-gnu-gcc
5049 export CXX=loongarch64-unknown-linux-gnu-g++
@@ -126,9 +125,12 @@ export JOBS=$max_thread
126125# 每个模块单独 rebuild,因为交叉编译时可能需要单独调整配置
127126cd " ${package_dir} /node_modules_tmp/node_modules"
128127
128+ node_version=$( node $root_dir /tools/parse-config.js --get-node-version $@ )
129+ configure_args=" --target_platform=linux --target_arch=${arch} --verbose --host --target=v$node_version "
130+
129131cd nodegit
130132notice " Build nodegit"
131- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
133+ node-gyp configure " $configure_args "
132134if [ " $arch " == " loong64" ]; then
133135 sed -i ' s#libssh2ConfigureScript,#`${libssh2ConfigureScript} --host=loongarch64-unknown-linux-gnu`,#' utils/configureLibssh2.js
134136fi
@@ -137,18 +139,18 @@ rm -rf .github include src lifecycleScripts vendor utils build/vendor build/Rele
137139cd ..
138140
139141cd extract-file-icon
140- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
142+ node-gyp configure " $configure_args "
141143node-gyp build
142144cd ..
143145
144146cd native-keymap
145- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
147+ node-gyp configure " $configure_args "
146148node-gyp build
147149cd ..
148150
149151cd node-pty
150152# node build
151- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
153+ node-gyp configure " $configure_args "
152154node-gyp build
153155cd ..
154156# nw rebuild
@@ -177,7 +179,7 @@ if [ "$arch" == "loong64" ];then
177179 export CFLAGS=" $CFLAGS -x c -std=gnu89 -Wno-error=incompatible-pointer-types -Wno-incompatible-pointer-types"
178180 export CXXFLAGS=" $CXXFLAGS -Wno-error=incompatible-pointer-types -Wno-incompatible-pointer-types"
179181fi
180- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
182+ node-gyp configure " $configure_args "
181183node-gyp build
182184cd ../oniguruma
183185notice " rebuild oniguruma"
@@ -191,7 +193,7 @@ cd ..
191193
192194cp -fr " spdlog" " spdlog-node"
193195cd spdlog-node
194- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
196+ node-gyp configure " $configure_args "
195197node-gyp build
196198cd ..
197199mkdir -p @vscode
@@ -203,7 +205,7 @@ cd ..
203205
204206cd @vscode/sqlite3
205207notice " Build @vscode/sqlite3"
206- node-gyp configure --target_platform=linux --target_arch= ${arch} --verbose --host
208+ node-gyp configure " $configure_args "
207209node-gyp build
208210cd ../..
209211
0 commit comments