File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
libs/openFrameworksCompiled/project Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 2727
2828include $(OF_SHARED_MAKEFILES_PATH ) /config.linux.common.mk
2929
30- PLATFORM_LDFLAGS += -fuse-ld=gold
30+ ifneq (, $(shell command -v mold) )
31+ PLATFORM_LDFLAGS += -fuse-ld=mold
32+ else ifneq (, $(shell command -v gold))
33+ PLATFORM_LDFLAGS += -fuse-ld=gold
34+ endif
Original file line number Diff line number Diff line change @@ -116,6 +116,12 @@ function pkgExists(pkg){
116116 return pkgconfig . exitCode ( ) === 0 ;
117117}
118118
119+ function commandExists ( command ) {
120+ var commandProcess = new Process ( ) ;
121+ commandProcess . exec ( 'command' , [ '-v' , command ] ) ;
122+ return commandProcess . exitCode ( ) === 0 ;
123+ }
124+
119125function findLibsRecursive ( dir , platform , exclude ) {
120126 var ret = [ ]
121127 if ( ! File . exists ( dir ) ) {
Original file line number Diff line number Diff line change @@ -210,7 +210,9 @@ Module{
210210 ldflags = Helpers .pkgconfig (configs, [" --libs-only-L" ]);
211211 if (platform === " msys2" ){
212212 ldflags .push (" -L" + FileInfo .joinPaths (Helpers .msys2root ()," mingw32/lib" ));
213- }else {
213+ }else if (Helpers .commandExists (" mold" )) {
214+ ldflags .push (" -fuse-ld=mold" );
215+ }else if (Helpers .commandExists (" gold" )) {
214216 ldflags .push (" -fuse-ld=gold" );
215217 }
216218 }else {
You can’t perform that action at this time.
0 commit comments