@@ -40,13 +40,16 @@ pub fn build(b: *std.Build) void {
4040 "libregexp.c" ,
4141 "libunicode.c" ,
4242 "cutils.c" ,
43- "libbf .c" ,
43+ "xsum .c" ,
4444 };
4545
46- const libquickjs = b .addStaticLibrary (.{
46+ const libquickjs = b .addLibrary (.{
4747 .name = "quickjs" ,
48- .target = target ,
49- .optimize = optimize ,
48+ .linkage = .static ,
49+ .root_module = b .createModule (.{
50+ .target = target ,
51+ .optimize = optimize ,
52+ }),
5053 });
5154 libquickjs .addCSourceFiles (.{
5255 .files = libquickjs_source ,
@@ -58,12 +61,17 @@ pub fn build(b: *std.Build) void {
5861 addStdLib (libquickjs , cflags , csrc );
5962 }
6063 libquickjs .linkLibC ();
64+ if (target .result .os .tag == .windows ) {
65+ libquickjs .stack_size = 8388608 ;
66+ }
6167 b .installArtifact (libquickjs );
6268
6369 const qjsc = b .addExecutable (.{
6470 .name = "qjsc" ,
65- .target = target ,
66- .optimize = optimize ,
71+ .root_module = b .createModule (.{
72+ .target = target ,
73+ .optimize = optimize ,
74+ }),
6775 });
6876 qjsc .addCSourceFiles (.{
6977 .files = &.{"qjsc.c" },
@@ -79,9 +87,16 @@ pub fn build(b: *std.Build) void {
7987
8088 const qjsc_host = b .addExecutable (.{
8189 .name = "qjsc-host" ,
82- .target = b .graph .host ,
83- .optimize = .Debug ,
90+ .root_module = b .createModule (.{
91+ .target = b .graph .host ,
92+ .optimize = .Debug ,
93+ }),
8494 });
95+
96+ if (b .graph .host .result .os .tag == .windows ) {
97+ qjsc_host .stack_size = 8388608 ;
98+ }
99+
85100 qjsc_host .addCSourceFiles (.{
86101 .files = &.{"qjsc.c" },
87102 .flags = cflags ,
@@ -104,18 +119,28 @@ pub fn build(b: *std.Build) void {
104119 _ = b .addModule ("quickjs-ng" , .{ .root_source_file = header .getOutput () });
105120
106121 const gen_repl = b .addRunArtifact (qjsc_host );
122+ gen_repl .addArg ("-N" );
123+ gen_repl .addArg ("qjsc_repl" );
107124 gen_repl .addArg ("-o" );
108125 const gen_repl_out = gen_repl .addOutputFileArg ("repl.c" );
109126 gen_repl .addArg ("-m" );
110127 gen_repl .addFileArg (csrc .path ("repl.js" ));
111128
112129 const gen_standalone = b .addRunArtifact (qjsc_host );
130+ gen_standalone .addArg ("-N" );
131+ gen_standalone .addArg ("qjsc_standalone" );
113132 gen_standalone .addArg ("-o" );
114133 const gen_standalone_out = gen_standalone .addOutputFileArg ("standalone.c" );
115134 gen_standalone .addArg ("-m" );
116135 gen_standalone .addFileArg (csrc .path ("standalone.js" ));
117136
118- const qjs = b .addExecutable (.{ .name = "qjs" , .target = target , .optimize = optimize });
137+ const qjs = b .addExecutable (.{
138+ .name = "qjs" ,
139+ .root_module = b .createModule (.{
140+ .target = target ,
141+ .optimize = optimize ,
142+ }),
143+ });
119144 qjs .addCSourceFiles (.{
120145 .files = &.{"qjs.c" },
121146 .flags = cflags ,
0 commit comments