@@ -51,22 +51,12 @@ let newBsPackage = (~overrideBuildSystem=?, ~reportDiagnostics, state, rootPath)
51
51
let %try bsPlatform = BuildSystem.getBsPlatformDir(rootPath);
52
52
53
53
54
- let nodePlatform =
55
- switch (Sys . os_type) {
56
- | "Unix" => switch (input_line (Unix . open_process_in ("uname -s" ))) {
57
- | "Darwin" => "darwin"
58
- | "Linux" => "linux"
59
- | "FreeBSD" => "freebsd"
60
- | s => invalid_arg (s ++ ": unsupported os_type" )
61
- }
62
- | "Win32" => "win32"
63
- | s => invalid_arg (s ++ ": unsupported os_type" )
64
- };
54
+
65
55
66
56
let bsb = switch (Files . ifExists(bsPlatform /+ "lib" /+ "bsb.exe" )){
67
57
| Some (x ) => x
68
58
| None =>
69
- switch (Files . ifExists(bsPlatform /+ nodePlatform /+ "bsb.exe" )){
59
+ switch (Files . ifExists(bsPlatform /+ BuildSystem . nodePlatform /+ "bsb.exe" )){
70
60
| Some (x ) => x
71
61
| None => failwith ("can not locate bsb.exe in " ++ bsPlatform)
72
62
}
@@ -189,7 +179,7 @@ let newBsPackage = (~overrideBuildSystem=?, ~reportDiagnostics, state, rootPath)
189
179
};
190
180
191
181
let flags = switch buildSystem {
192
- | Bsb (_ ) | BsbNative (_ , Js ) => {
182
+ | Bsb (version ) | BsbNative (version , Js ) => {
193
183
194
184
let jsPackageMode = {
195
185
let specs = config |> Json . get("package-specs" );
@@ -212,7 +202,7 @@ let newBsPackage = (~overrideBuildSystem=?, ~reportDiagnostics, state, rootPath)
212
202
| _ => flags;
213
203
};
214
204
/* flags */
215
- [ "-bs-no-builtin-ppx-ml" , ... flags] ;
205
+ [ version > "7.1" ? "-bs-no-builtin-ppx" : "-bs-no-builtin-ppx-ml" , ... flags] ;
216
206
}
217
207
| _ => flags
218
208
};
0 commit comments