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
19
19
add_builtin (fastly::cache_override SRC builtins/cache-override.cpp )
20
20
add_builtin (fastly::fetch_event SRC builtins/fetch-event.cpp DEPENDENCIES OpenSSL )
21
21
22
+ add_compile_definitions (PUBLIC RUNTIME_VERSION=${RUNTIME_VERSION} )
23
+
22
24
project (FastlyJS )
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
cd " $( 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 \" "
4
5
cmake --build build-debug --parallel 10
5
6
mv build-debug/starling.wasm/starling.wasm ../../
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
cd " $( 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 \" "
4
5
cmake --build build-release
5
6
mv build-release/starling.wasm/starling.wasm ../../
Original file line number Diff line number Diff line change 11
11
12
12
namespace fastly ::fastly {
13
13
14
- #define RUNTIME_VERSION " starlingmonkey-dev"
15
-
16
14
class Env : public builtins ::BuiltinNoConstructor<Env> {
17
15
private:
18
16
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)
38
38
# Default optimization flgs for clang/clang++.
39
39
OPT_FLAGS ?= -O2
40
40
41
+ RUNTIME_VERSION ?= $(shell npm pkg get version --json | jq -r)
42
+
41
43
# Command helpers for making nice build output.
42
44
include mk/commands.mk
43
45
@@ -92,6 +94,7 @@ SM_OBJ += $(wildcard $(SM_SRC)/lib/*.a)
92
94
# This is required when using spidermonkey headers, as it allows us to enable
93
95
# the streams library when setting up the js context.
94
96
DEFINES := -DMOZ_JS_STREAMS
97
+ DEFINES += -DRUNTIME_VERSION='"$(RUNTIME_VERSION ) "'
95
98
96
99
# Flags for c++ compilation
97
100
CXX_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] = {
32
32
33
33
#include " host_interface/host_api.h"
34
34
35
- #define RUNTIME_VERSION " 3.13.2-dev"
36
-
37
35
const JSErrorFormatString *GetErrorMessage (void *userRef, unsigned errorNumber);
38
36
39
37
JSObject *PromiseRejectedWithPendingError (JSContext *cx);
You can’t perform that action at this time.
0 commit comments