Skip to content

Commit 5597cfd

Browse files
authored
Merge pull request #330 from foxever/master
bind: fixed LDFLAGS on windows if python include path contains capital letters
2 parents 5bc603e + 385862d commit 5597cfd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bind/utils.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,10 @@ else:
186186
raw.LibDir = filepath.ToSlash(raw.LibDir)
187187

188188
// on windows these can be empty -- use include dir which is usu good
189+
// replace suffix case insensitive 'include' with 'libs'
189190
if raw.LibDir == "" && raw.IncDir != "" {
190-
raw.LibDir = raw.IncDir
191-
if strings.HasSuffix(raw.LibDir, "include") {
192-
raw.LibDir = raw.LibDir[:len(raw.LibDir)-len("include")] + "libs"
193-
}
191+
regexInc := regexp.MustCompile(`(?i)\binclude$`)
192+
raw.LibDir = regexInc.ReplaceAllString(raw.IncDir, "libs")
194193
fmt.Printf("no LibDir -- copy from IncDir: %s\n", raw.LibDir)
195194
}
196195

0 commit comments

Comments
 (0)