harfbuzz multithreaded build

This commit is contained in:
nakst 2022-02-02 16:07:04 +00:00
parent 63521a9f62
commit 734435b5fc
1 changed files with 6 additions and 3 deletions

View File

@ -503,15 +503,18 @@ void PortHarfBuzz() {
]; ];
str link = "%toolchainPrefix%-ar cr libharfbuzz.a "; str link = "%toolchainPrefix%-ar cr libharfbuzz.a ";
int[] tasks = new int[];
for int i = 0; i < sources:len(); i += 1 { for int i = 0; i < sources:len(); i += 1 {
assert SystemShellExecuteWithWorkingDirectory("bin/harfbuzz/src", if tasks:len() == processorCount { tasks:find_and_delete(await tasks); }
"%toolchainPrefix%-gcc -c %sources[i]%.cc -o %sources[i]%.o " str command = "%toolchainPrefix%-gcc -c %sources[i]%.cc -o %sources[i]%.o "
+ "-DHAVE_CONFIG_H -I. -I.. -ffreestanding -fno-rtti -g -O3 -DHB_TINY -fno-exceptions -fno-threadsafe-statics " + "-DHAVE_CONFIG_H -I. -I.. -ffreestanding -fno-rtti -g -O3 -DHB_TINY -fno-exceptions -fno-threadsafe-statics "
+ "-fvisibility-inlines-hidden -DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR -I../../../root/Applications/POSIX/include"); + "-fvisibility-inlines-hidden -DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR -I../../../root/Applications/POSIX/include";
tasks:add(SystemShellExecuteWithWorkingDirectory:curry("bin/harfbuzz/src"):curry(command):assert():async());
link += sources[i] + ".o "; link += sources[i] + ".o ";
} }
while tasks:len() != 0 { tasks:find_and_delete(await tasks); }
assert SystemShellExecuteWithWorkingDirectory("bin/harfbuzz/src", link); assert SystemShellExecuteWithWorkingDirectory("bin/harfbuzz/src", link);
assert SystemShellExecuteWithWorkingDirectory("bin/harfbuzz/src", "%toolchainPrefix%-ranlib libharfbuzz.a"); assert SystemShellExecuteWithWorkingDirectory("bin/harfbuzz/src", "%toolchainPrefix%-ranlib libharfbuzz.a");
assert FileCopy("bin/harfbuzz/src/libharfbuzz.a", "bin/harfbuzz/libharfbuzz_%targetName%.a"); assert FileCopy("bin/harfbuzz/src/libharfbuzz.a", "bin/harfbuzz/libharfbuzz_%targetName%.a");