File tree Expand file tree Collapse file tree 6 files changed +9
-6
lines changed
Expand file tree Collapse file tree 6 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,6 @@ add_builtin(fastly::fetch SRC builtins/fetch/fetch.cpp builtins/fetch/request-re
1919add_builtin(fastly::cache_override SRC builtins/cache -override.cpp)
2020add_builtin(fastly::fetch_event SRC builtins/fetch-event.cpp DEPENDENCIES OpenSSL)
2121
22+ add_compile_definitions (PUBLIC RUNTIME_VERSION=${RUNTIME_VERSION} )
23+
2224project (FastlyJS)
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22cd " $( dirname " $0 " ) " || exit 1
3- HOST_API=$( realpath host-api) cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0
3+ RUNTIME_VERSION=$( npm pkg get version --json --prefix=../../ | jq -r)
4+ HOST_API=$( realpath host-api) cmake -B build-debug -DCMAKE_BUILD_TYPE=Debug -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0 -DRUNTIME_VERSION=" \" starlingmonkey-$RUNTIME_VERSION \" "
45cmake --build build-debug --parallel 10
56mv build-debug/starling.wasm/starling.wasm ../../
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22cd " $( dirname " $0 " ) " || exit 1
3- HOST_API=$( realpath host-api) cmake -B build-release -DCMAKE_BUILD_TYPE=Release -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0
3+ RUNTIME_VERSION=$( npm pkg get version --json --prefix=../../ | jq -r)
4+ HOST_API=$( realpath host-api) cmake -B build-release -DCMAKE_BUILD_TYPE=Release -DENABLE_BUILTIN_WEB_FETCH=0 -DENABLE_BUILTIN_WEB_FETCH_FETCH_EVENT=0 -DRUNTIME_VERSION=" \" starlingmonkey-$RUNTIME_VERSION \" "
45cmake --build build-release
56mv build-release/starling.wasm/starling.wasm ../../
Original file line number Diff line number Diff line change 1111
1212namespace fastly ::fastly {
1313
14- #define RUNTIME_VERSION " starlingmonkey-dev"
15-
1614class Env : public builtins ::BuiltinNoConstructor<Env> {
1715private:
1816 static bool env_get (JSContext *cx, unsigned argc, JS::Value *vp);
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ WIT_BINDGEN ?= $(shell which wit-bindgen)
3838# Default optimization flgs for clang/clang++.
3939OPT_FLAGS ?= -O2
4040
41+ RUNTIME_VERSION ?= $(shell npm pkg get version --json | jq -r)
42+
4143# Command helpers for making nice build output.
4244include mk/commands.mk
4345
@@ -92,6 +94,7 @@ SM_OBJ += $(wildcard $(SM_SRC)/lib/*.a)
9294# This is required when using spidermonkey headers, as it allows us to enable
9395# the streams library when setting up the js context.
9496DEFINES := -DMOZ_JS_STREAMS
97+ DEFINES += -DRUNTIME_VERSION='"$(RUNTIME_VERSION ) "'
9598
9699# Flags for c++ compilation
97100CXX_FLAGS := -std=gnu++20 -Wall -Werror -Qunused-arguments
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ const JSErrorFormatString js_ErrorFormatString[JSErrNum_Limit] = {
3232
3333#include " host_interface/host_api.h"
3434
35- #define RUNTIME_VERSION " 3.13.2-dev"
36-
3735const JSErrorFormatString *GetErrorMessage (void *userRef, unsigned errorNumber);
3836
3937JSObject *PromiseRejectedWithPendingError (JSContext *cx);
You can’t perform that action at this time.
0 commit comments