Skip to content

Commit f5c54a4

Browse files
committed
Build Common library
1 parent 5c854f7 commit f5c54a4

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/lib.rs

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ impl Build {
158158
.compile(codegen_lib_name);
159159
}
160160

161+
// Build `Common` library
162+
let common_lib_name = "luaucommon";
163+
let common_source_dir = source_base_dir.join("luau").join("Common").join("src");
164+
let common_include_dir = (source_base_dir.join("luau").join("Common")).join("include");
165+
config
166+
.clone()
167+
.include(&common_include_dir)
168+
.add_files_by_ext_sorted(&common_source_dir, "cpp")
169+
.out_dir(&build_dir)
170+
.compile(common_lib_name);
171+
161172
// Build `Compiler` library
162173
let compiler_lib_name = "luaucompiler";
163174
let compiler_source_dir = source_base_dir.join("luau").join("Compiler").join("src");
@@ -198,25 +209,15 @@ impl Build {
198209

199210
// Build `Require` library
200211
let require_lib_name = "luaurequire";
201-
let require_base_dir = source_base_dir.join("luau").join("Require");
202-
let require_source_dirs = &[
203-
require_base_dir.join("Navigator").join("src"),
204-
require_base_dir.join("Runtime").join("src"),
205-
];
206-
let require_include_dirs = &[
207-
require_base_dir.join("Navigator").join("include"),
208-
require_base_dir.join("Runtime").join("include"),
209-
];
210-
let mut require_config = config.clone();
211-
for (source_dir, include_dir) in require_source_dirs.iter().zip(require_include_dirs) {
212-
require_config
213-
.include(include_dir)
214-
.add_files_by_ext_sorted(source_dir, "cpp");
215-
}
216-
require_config
212+
let require_source_dir = source_base_dir.join("luau").join("Require").join("src");
213+
let require_include_dir = source_base_dir.join("luau").join("Require").join("include");
214+
config
215+
.clone()
216+
.include(&require_include_dir)
217217
.include(&ast_include_dir)
218218
.include(&config_include_dir)
219219
.include(&vm_include_dir)
220+
.add_files_by_ext_sorted(&require_source_dir, "cpp")
220221
.out_dir(&build_dir)
221222
.compile(require_lib_name);
222223

@@ -235,8 +236,9 @@ impl Build {
235236
vm_lib_name.to_string(),
236237
compiler_lib_name.to_string(),
237238
ast_lib_name.to_string(),
238-
custom_lib_name.to_string(),
239+
common_lib_name.to_string(),
239240
config_lib_name.to_string(),
241+
custom_lib_name.to_string(),
240242
require_lib_name.to_string(),
241243
],
242244
cpp_stdlib: Self::get_cpp_link_stdlib(target, host),

0 commit comments

Comments
 (0)