Skip to content

Commit

Permalink
Fix compile action and remove QGIS_JS env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
boardend committed Jun 27, 2024
1 parent bf6bbfb commit bbd63af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 3 additions & 9 deletions build/actions/compile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { dirname } from "path";
import { dirname, join } from "path";
import { fileURLToPath } from "url";

import {
Expand Down Expand Up @@ -53,7 +53,7 @@ export class CompileAction extends CommandLineAction {
const v = this._options.verbose;
$.verbose = true;

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

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

// set qgis-js internal environment variables
process.env.QGIS_JS_VCPKG = `${repo}/build/vcpkg`;
process.env.QGIS_JS_EMSDK = `${repo}/build/emsdk`;

// set environment variables for CMake
process.env.VCPKG_BINARY_SOURCES = "clear";
if (debug) {
Expand All @@ -109,9 +105,7 @@ export class CompileAction extends CommandLineAction {
-S . \
-B build/wasm \
-G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${
process.env.QGIS_JS_VCPKG
}/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_TOOLCHAIN_FILE=${repo}/build/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${repo}/build/vcpkg-toolchains/qgis-js.cmake \
-DVCPKG_OVERLAY_TRIPLETS=./build/vcpkg-triplets \
-DVCPKG_OVERLAY_PORTS=./build/vcpkg-ports \
Expand Down
4 changes: 2 additions & 2 deletions build/vcpkg-toolchains/qgis-js.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ message(STATUS "Using 'qgis-js' toolchain")

# use/derrive EMSDK and EMSCRIPTEN_ROOT to locate EMSCRIPTEN_TOOLCHAIN_FILE
if(NOT DEFINED ENV{EMSDK})
get_filename_component(QGIS_JS_EMSDK
get_filename_component(QGIS_JS_BUILD_EMSDK
"${CMAKE_CURRENT_LIST_DIR}/../emsdk"
ABSOLUTE)
set(ENV{EMSDK} ${QGIS_JS_EMSDK})
set(ENV{EMSDK} ${QGIS_JS_BUILD_EMSDK})
endif()
if(NOT EMSCRIPTEN_ROOT)
if(NOT DEFINED ENV{EMSDK})
Expand Down

0 comments on commit bbd63af

Please sign in to comment.