Skip to content

Commit bbd63af

Browse files
committed
Fix compile action and remove QGIS_JS env vars
1 parent bf6bbfb commit bbd63af

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

build/actions/compile.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dirname } from "path";
1+
import { dirname, join } from "path";
22
import { fileURLToPath } from "url";
33

44
import {
@@ -53,7 +53,7 @@ export class CompileAction extends CommandLineAction {
5353
const v = this._options.verbose;
5454
$.verbose = true;
5555

56-
const repo = dirname(fileURLToPath(import.meta.url));
56+
const repo = join(dirname(fileURLToPath(import.meta.url)), "../..");
5757

5858
const buildType = (this._buildType.value || "Dev") as BuildType;
5959
const debug = this._debug.value || false;
@@ -88,10 +88,6 @@ export class CompileAction extends CommandLineAction {
8888
if (v) console.log(`"${CMakeCacheFile}" does not exist`);
8989
}
9090

91-
// set qgis-js internal environment variables
92-
process.env.QGIS_JS_VCPKG = `${repo}/build/vcpkg`;
93-
process.env.QGIS_JS_EMSDK = `${repo}/build/emsdk`;
94-
9591
// set environment variables for CMake
9692
process.env.VCPKG_BINARY_SOURCES = "clear";
9793
if (debug) {
@@ -109,9 +105,7 @@ export class CompileAction extends CommandLineAction {
109105
-S . \
110106
-B build/wasm \
111107
-G Ninja \
112-
-DCMAKE_TOOLCHAIN_FILE=${
113-
process.env.QGIS_JS_VCPKG
114-
}/scripts/buildsystems/vcpkg.cmake \
108+
-DCMAKE_TOOLCHAIN_FILE=${repo}/build/vcpkg/scripts/buildsystems/vcpkg.cmake \
115109
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${repo}/build/vcpkg-toolchains/qgis-js.cmake \
116110
-DVCPKG_OVERLAY_TRIPLETS=./build/vcpkg-triplets \
117111
-DVCPKG_OVERLAY_PORTS=./build/vcpkg-ports \

build/vcpkg-toolchains/qgis-js.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ message(STATUS "Using 'qgis-js' toolchain")
33

44
# use/derrive EMSDK and EMSCRIPTEN_ROOT to locate EMSCRIPTEN_TOOLCHAIN_FILE
55
if(NOT DEFINED ENV{EMSDK})
6-
get_filename_component(QGIS_JS_EMSDK
6+
get_filename_component(QGIS_JS_BUILD_EMSDK
77
"${CMAKE_CURRENT_LIST_DIR}/../emsdk"
88
ABSOLUTE)
9-
set(ENV{EMSDK} ${QGIS_JS_EMSDK})
9+
set(ENV{EMSDK} ${QGIS_JS_BUILD_EMSDK})
1010
endif()
1111
if(NOT EMSCRIPTEN_ROOT)
1212
if(NOT DEFINED ENV{EMSDK})

0 commit comments

Comments
 (0)