mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
Move include path logic for develop into setup.py
This commit is contained in:
@@ -187,7 +187,6 @@ func build(args []string) {
|
|||||||
}
|
}
|
||||||
python := ""
|
python := ""
|
||||||
root, _ := filepath.Abs(filepath.Join(folder, "root"))
|
root, _ := filepath.Abs(filepath.Join(folder, "root"))
|
||||||
path_args := []string{"-I" + filepath.Join(root, "include"), "-L" + filepath.Join(root, "lib")}
|
|
||||||
os.Setenv("DEVELOP_ROOT", root)
|
os.Setenv("DEVELOP_ROOT", root)
|
||||||
prepend("PKG_CONFIG_PATH", filepath.Join(root, "lib", "pkgconfig"))
|
prepend("PKG_CONFIG_PATH", filepath.Join(root, "lib", "pkgconfig"))
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
@@ -198,8 +197,7 @@ func build(args []string) {
|
|||||||
default:
|
default:
|
||||||
exit("Building is only supported on Linux and macOS")
|
exit("Building is only supported on Linux and macOS")
|
||||||
}
|
}
|
||||||
args = append([]string{"setup.py", "develop", "--debug"}, path_args...)
|
cmd := exec.Command(python, "setup.py", "develop", "--debug")
|
||||||
cmd := exec.Command(python, args...)
|
|
||||||
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
|
cmd.Stdout, cmd.Stderr = os.Stdout, os.Stderr
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
fmt.Fprintln(os.Stderr, "The following build command failed:", python, strings.Join(args, " "))
|
fmt.Fprintln(os.Stderr, "The following build command failed:", python, strings.Join(args, " "))
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -438,6 +438,10 @@ def init_env(
|
|||||||
set_arches(cflags)
|
set_arches(cflags)
|
||||||
set_arches(ldflags)
|
set_arches(ldflags)
|
||||||
|
|
||||||
|
if os.environ.get("DEVELOP_ROOT"):
|
||||||
|
cflags.insert(0, f'-I{os.environ["DEVELOP_ROOT"]}/include')
|
||||||
|
ldpaths.insert(0, f'-L{os.environ["DEVELOP_ROOT"]}/lib')
|
||||||
|
|
||||||
return Env(cc, cppflags, cflags, ldflags, library_paths, ccver=ccver, ldpaths=ldpaths, vcs_rev=vcs_rev)
|
return Env(cc, cppflags, cflags, ldflags, library_paths, ccver=ccver, ldpaths=ldpaths, vcs_rev=vcs_rev)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user