forked from revery-ui/revery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
464c5b7
commit 4d07f14
Showing
4 changed files
with
115 additions
and
111 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
type os = | ||
| Windows | ||
| Mac | ||
| Linux | ||
| Unknown; | ||
|
||
let uname = () => { | ||
let ic = Unix.open_process_in("uname"); | ||
let uname = input_line(ic); | ||
let () = close_in(ic); | ||
uname; | ||
}; | ||
|
||
let get_os = | ||
switch (Sys.os_type) { | ||
| "Win32" => Windows | ||
| _ => | ||
switch (uname()) { | ||
| "Darwin" => Mac | ||
| "Linux" => Linux | ||
| _ => Unknown | ||
} | ||
}; | ||
|
||
let root = Sys.getenv("cur__root"); | ||
let c_flags = []; | ||
|
||
let ccopt = s => ["-ccopt", s]; | ||
let cclib = s => ["-cclib", s]; | ||
|
||
let flags = | ||
switch (get_os) { | ||
| Windows => [] @ cclib("-ldwrite") @ cclib("-lstdc++") | ||
| Linux => | ||
[] @ cclib("-lfontconfig") @ cclib("-lstdc++") @ ccopt("-I/usr/include") | ||
| Mac => | ||
[] | ||
@ ccopt("-framework CoreText") | ||
@ ccopt("-framework Foundation") | ||
@ cclib("-lstdc++") | ||
| _ => [] | ||
}; | ||
|
||
let flags_with_sanitize = | ||
switch (get_os) { | ||
| Linux => flags @ ccopt("-fsanitize=address") | ||
| _ => flags | ||
}; | ||
|
||
let cxx_flags = | ||
switch (get_os) { | ||
| Linux => c_flags @ ["-fPIC", "-lstdc++"] | ||
| Mac => c_flags @ ["-x", "objective-c++", "-lstdc++"] | ||
| Windows => c_flags @ ["-fno-exceptions", "-fno-rtti", "-lstdc++"] | ||
| _ => c_flags | ||
}; | ||
|
||
Configurator.V1.Flags.write_sexp("c_flags.sexp", c_flags); | ||
Configurator.V1.Flags.write_sexp("cxx_flags.sexp", cxx_flags); | ||
Configurator.V1.Flags.write_sexp("flags.sexp", flags); | ||
Configurator.V1.Flags.write_sexp( | ||
"flags_with_sanitize.sexp", | ||
flags_with_sanitize, | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
type os = | ||
| Windows | ||
| Mac | ||
| Linux | ||
| Unknown; | ||
|
||
let uname = () => { | ||
let ic = Unix.open_process_in("uname"); | ||
let uname = input_line(ic); | ||
let () = close_in(ic); | ||
uname; | ||
}; | ||
|
||
let get_os = | ||
switch (Sys.os_type) { | ||
| "Win32" => Windows | ||
| _ => | ||
switch (uname()) { | ||
| "Darwin" => Mac | ||
| "Linux" => Linux | ||
| _ => Unknown | ||
} | ||
}; | ||
|
||
let c_flags = ["-fPIC", "-I", Sys.getenv("HARFBUZZ_INCLUDE_PATH")]; | ||
|
||
let ccopt = s => ["-ccopt", s]; | ||
let cclib = s => ["-cclib", s]; | ||
|
||
let extraFlags = | ||
switch (get_os) { | ||
| Linux => ccopt("-L/usr/lib") | ||
| _ => [] | ||
}; | ||
|
||
let lib_path_flags = | ||
switch (get_os) { | ||
| _ => [] @ ccopt("-L" ++ Sys.getenv("HARFBUZZ_LIB_PATH")) | ||
}; | ||
|
||
let flags = [] @ cclib("-lharfbuzz") @ extraFlags @ lib_path_flags; | ||
|
||
let cxx_flags = | ||
switch (get_os) { | ||
| Windows => c_flags @ ["-fno-exceptions", "-fno-rtti", "-lstdc++"] | ||
| _ => c_flags | ||
}; | ||
|
||
Configurator.V1.Flags.write_sexp("c_flags.sexp", c_flags); | ||
Configurator.V1.Flags.write_sexp("cxx_flags.sexp", cxx_flags); | ||
Configurator.V1.Flags.write_sexp("flags.sexp", flags); |