Skip to content

Commit faa97e2

Browse files
committed
Fallback to 'compiler.ldflags' if platform does not define 'compiler.libraries.ldflags'
1 parent fa29224 commit faa97e2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

legacy/builder/phases/libraries_builder.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,14 @@ func fixLDFLAG(ctx *types.Context, libs libraries.List) error {
134134
}
135135
}
136136

137-
currLDFlags := ctx.BuildProperties.Get(constants.BUILD_PROPERTIES_COMPILER_LIBRARIES_LDFLAGS)
138-
ctx.BuildProperties.Set(constants.BUILD_PROPERTIES_COMPILER_LIBRARIES_LDFLAGS, currLDFlags+"\"-L"+path.String()+"\" "+libsCmd+" ")
137+
key := "compiler.libraries.ldflags"
138+
if !ctx.BuildProperties.ContainsKey(key) {
139+
logger := ctx.GetLogger()
140+
logger.Fprintln(os.Stdout, constants.LOG_LEVEL_INFO, "The plaform doesn't support 'compiler.libraries.ldflags' for precompiled libraries... trying with 'compiler.ldflags'.")
141+
key = "compiler.ldflags"
142+
}
143+
currLDFlags := ctx.BuildProperties.Get(key)
144+
ctx.BuildProperties.Set(key, currLDFlags+" \"-L"+path.String()+"\" "+libsCmd+" ")
139145
}
140146
return nil
141147
}

0 commit comments

Comments
 (0)