llcppsymg:gendylib path test
llcppsymg:headerpath test
This commit is contained in:
23
chore/_xtool/llcppsymg/header/header.go
Normal file
23
chore/_xtool/llcppsymg/header/header.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package header
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GenHeaderFilePath(cflags string, files []string) ([]string, error) {
|
||||
fmt.Printf("get filepath from config cflags%s & include:%v\n", cflags, files)
|
||||
prefixPath := strings.TrimPrefix(cflags, "-I")
|
||||
var includePaths []string
|
||||
for _, file := range files {
|
||||
if file == "" {
|
||||
continue
|
||||
}
|
||||
includePaths = append(includePaths, filepath.Join(prefixPath, "/"+file))
|
||||
}
|
||||
if len(includePaths) == 0 {
|
||||
return nil, fmt.Errorf("no valid header files")
|
||||
}
|
||||
return includePaths, nil
|
||||
}
|
||||
Reference in New Issue
Block a user