builder: also check lib64 for clang include path.
On 64-bit Fedora, `lib64` is where the clang headers are, not `lib`. For multiarch systems, both will exist, but it's likely you want 64-bit, so check that first.
Этот коммит содержится в:
родитель
13fe668929
коммит
41afb77080
1 изменённых файлов: 10 добавлений и 4 удалений
|
@ -40,14 +40,20 @@ func getClangHeaderPath(TINYGOROOT string) string {
|
||||||
// Example executable:
|
// Example executable:
|
||||||
// /usr/lib/llvm-9/bin/clang
|
// /usr/lib/llvm-9/bin/clang
|
||||||
// Example include path:
|
// Example include path:
|
||||||
// /usr/lib/llvm-9/lib/clang/9.0.1/include/
|
// /usr/lib/llvm-9/lib64/clang/9.0.1/include/
|
||||||
llvmRoot := filepath.Dir(filepath.Dir(binpath))
|
llvmRoot := filepath.Dir(filepath.Dir(binpath))
|
||||||
clangVersionRoot := filepath.Join(llvmRoot, "lib", "clang")
|
clangVersionRoot := filepath.Join(llvmRoot, "lib64", "clang")
|
||||||
dirs, err := ioutil.ReadDir(clangVersionRoot)
|
dirs, err := ioutil.ReadDir(clangVersionRoot)
|
||||||
|
if err != nil {
|
||||||
|
// Example include path:
|
||||||
|
// /usr/lib/llvm-9/lib/clang/9.0.1/include/
|
||||||
|
clangVersionRoot = filepath.Join(llvmRoot, "lib", "clang")
|
||||||
|
dirs, err = ioutil.ReadDir(clangVersionRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Unexpected.
|
// Unexpected.
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dirnames := make([]string, len(dirs))
|
dirnames := make([]string, len(dirs))
|
||||||
for i, d := range dirs {
|
for i, d := range dirs {
|
||||||
dirnames[i] = d.Name()
|
dirnames[i] = d.Name()
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче