Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@

include $(OF_SHARED_MAKEFILES_PATH)/config.linux.common.mk

PLATFORM_LDFLAGS += -fuse-ld=gold
ifneq (, $(shell command -v mold))
PLATFORM_LDFLAGS += -fuse-ld=mold
else ifneq (, $(shell command -v gold))
PLATFORM_LDFLAGS += -fuse-ld=gold
endif
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ function pkgExists(pkg){
return pkgconfig.exitCode() === 0;
}

function commandExists(command) {
var commandProcess = new Process();
commandProcess.exec('command', ['-v', command]);
return commandProcess.exitCode() === 0;
}

function findLibsRecursive(dir, platform, exclude){
var ret = []
if(!File.exists(dir)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ Module{
ldflags = Helpers.pkgconfig(configs, ["--libs-only-L"]);
if(platform === "msys2"){
ldflags.push("-L"+FileInfo.joinPaths(Helpers.msys2root(),"mingw32/lib"));
}else{
}else if (Helpers.commandExists("mold")) {
ldflags.push("-fuse-ld=mold");
}else if (Helpers.commandExists("gold")) {
ldflags.push("-fuse-ld=gold");
}
}else{
Expand Down
Loading