mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Have gen/c code use relative includes
For example, gen/c/wuffs-std-gif.h now #include's "./wuffs-std-lzw.h" instead of "std/lzw.h", which removes the need to configure an -I directory when compiling it.
This commit is contained in:
1 parent
469ab1c9c1
commit
8eb9781a9d
5 files changed
+31
-13
No files matched your search
+2
-1
@@ -204,7 +204,8 @@ func (h *genHelper) genDir(dirname string, qualFilenames []string) error {
|
||||
suffix = "h"
|
||||
}
|
||||
|
||||
if err := h.genFile(dirname, lang, suffix, out); err != nil {
|
||||
flatDirname := fmt.Sprintf("wuffs-%s", strings.Replace(dirname, "/", "-", -1))
|
||||
if err := h.genFile(flatDirname, lang, suffix, out); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,16 @@ func genrelease(wuffsRoot string, langs []string, v cf.Version) error {
|
||||
}
|
||||
|
||||
func genreleaseLang(wuffsRoot string, revision string, v cf.Version, lang string, suffix string) (filename string, contents []byte, err error) {
|
||||
// During a transitional period (starting in November 2018), remove any
|
||||
// existing wuffs-c generated files that use the old naming scheme (e.g.
|
||||
// "base.h" or "std/gif.h") instead of the new naming scheme (e.g.
|
||||
// "wuffs-base.h" or "wuffs-std-gif.h").
|
||||
if lang == "c" {
|
||||
baseDir := filepath.Join(wuffsRoot, "gen", lang)
|
||||
os.Remove(filepath.Join(baseDir, "base.h"))
|
||||
os.RemoveAll(filepath.Join(baseDir, "std"))
|
||||
}
|
||||
|
||||
qualFilenames, err := findFiles(filepath.Join(wuffsRoot, "gen", lang), "."+suffix)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
|
||||
Reference in new issue
Block a user