@@ -40,13 +40,16 @@ pub fn build(b: *std.Build) void {
40
40
"libregexp.c" ,
41
41
"libunicode.c" ,
42
42
"cutils.c" ,
43
- "libbf .c" ,
43
+ "xsum .c" ,
44
44
};
45
45
46
- const libquickjs = b .addStaticLibrary (.{
46
+ const libquickjs = b .addLibrary (.{
47
47
.name = "quickjs" ,
48
- .target = target ,
49
- .optimize = optimize ,
48
+ .linkage = .static ,
49
+ .root_module = b .createModule (.{
50
+ .target = target ,
51
+ .optimize = optimize ,
52
+ }),
50
53
});
51
54
libquickjs .addCSourceFiles (.{
52
55
.files = libquickjs_source ,
@@ -58,12 +61,17 @@ pub fn build(b: *std.Build) void {
58
61
addStdLib (libquickjs , cflags , csrc );
59
62
}
60
63
libquickjs .linkLibC ();
64
+ if (target .result .os .tag == .windows ) {
65
+ libquickjs .stack_size = 8388608 ;
66
+ }
61
67
b .installArtifact (libquickjs );
62
68
63
69
const qjsc = b .addExecutable (.{
64
70
.name = "qjsc" ,
65
- .target = target ,
66
- .optimize = optimize ,
71
+ .root_module = b .createModule (.{
72
+ .target = target ,
73
+ .optimize = optimize ,
74
+ }),
67
75
});
68
76
qjsc .addCSourceFiles (.{
69
77
.files = &.{"qjsc.c" },
@@ -79,9 +87,16 @@ pub fn build(b: *std.Build) void {
79
87
80
88
const qjsc_host = b .addExecutable (.{
81
89
.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
+ }),
84
94
});
95
+
96
+ if (b .graph .host .result .os .tag == .windows ) {
97
+ qjsc_host .stack_size = 8388608 ;
98
+ }
99
+
85
100
qjsc_host .addCSourceFiles (.{
86
101
.files = &.{"qjsc.c" },
87
102
.flags = cflags ,
@@ -104,18 +119,28 @@ pub fn build(b: *std.Build) void {
104
119
_ = b .addModule ("quickjs-ng" , .{ .root_source_file = header .getOutput () });
105
120
106
121
const gen_repl = b .addRunArtifact (qjsc_host );
122
+ gen_repl .addArg ("-N" );
123
+ gen_repl .addArg ("qjsc_repl" );
107
124
gen_repl .addArg ("-o" );
108
125
const gen_repl_out = gen_repl .addOutputFileArg ("repl.c" );
109
126
gen_repl .addArg ("-m" );
110
127
gen_repl .addFileArg (csrc .path ("repl.js" ));
111
128
112
129
const gen_standalone = b .addRunArtifact (qjsc_host );
130
+ gen_standalone .addArg ("-N" );
131
+ gen_standalone .addArg ("qjsc_standalone" );
113
132
gen_standalone .addArg ("-o" );
114
133
const gen_standalone_out = gen_standalone .addOutputFileArg ("standalone.c" );
115
134
gen_standalone .addArg ("-m" );
116
135
gen_standalone .addFileArg (csrc .path ("standalone.js" ));
117
136
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
+ });
119
144
qjs .addCSourceFiles (.{
120
145
.files = &.{"qjs.c" },
121
146
.flags = cflags ,
0 commit comments