Skip to content

Commit ffcc65d

Browse files
committed
make bspack not relying on c stubs so that it can be running without compiling
1 parent 1deb31b commit ffcc65d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

jscomp/ext/ext_string.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ let replace_backward_slash (x : string)=
332332

333333
let empty = ""
334334

335-
#if BS_BROWSER then
335+
#if BS_BROWSER || BS_PACK then
336336
let compare = Bs_hash_stubs.string_length_based_compare
337337
#else
338338
external compare : string -> string -> int = "caml_string_length_based_compare" [@@noalloc];;

jscomp/ext/ext_string.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ val replace_backward_slash : string -> string
164164

165165
val empty : string
166166

167-
#if BS_BROWSER then
167+
#if BS_BROWSER || BS_PACK then
168168
val compare : string -> string -> int
169169
#else
170170
external compare : string -> string -> int = "caml_string_length_based_compare" [@@noalloc];;

jscomp/snapshot.ninja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ build $SNAP/unstable/all_ounit_tests.ml: bspack | ./bin/bspack.exe $LTO
4848
main = Ounit_tests_main
4949

5050
build $SNAP/unstable/bspack.ml: bspack | ./bin/bspack.exe $LTO
51-
flags = -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_PARSING -I $OCAML_SRC_UTILS -I stubs -I ext -I common -I depends -I core -I main -bs-main Bspack_main
51+
flags = -D BS_PACK=true -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_PARSING -I $OCAML_SRC_UTILS -I stubs -I ext -I common -I depends -I core -I main -bs-main Bspack_main
5252
main = Bspack_main
5353

5454
build $SNAP/unstable/js_compiler.ml: bspack | ./bin/bspack.exe $LTO

jscomp/stubs/bs_hash_stubs.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#if BS_BROWSER then
2+
#if BS_BROWSER || BS_PACK then
33

44

55
let hash_string : string -> int = Hashtbl.hash

0 commit comments

Comments
 (0)