diff --git a/tools/please_go/ChangeLog b/tools/please_go/ChangeLog index f5fb1393..6229167f 100644 --- a/tools/please_go/ChangeLog +++ b/tools/please_go/ChangeLog @@ -1,3 +1,7 @@ +Version 1.8.5 +-------------- + * in go_repo, add c source to the generated cgo_library (#213) + Version 1.8.4 -------------- * in go_repo's subrepo write build tags to the plz config diff --git a/tools/please_go/VERSION b/tools/please_go/VERSION index bfa363e7..8decb929 100644 --- a/tools/please_go/VERSION +++ b/tools/please_go/VERSION @@ -1 +1 @@ -1.8.4 +1.8.5 diff --git a/tools/please_go/generate/generate.go b/tools/please_go/generate/generate.go index a943b286..ef5079aa 100644 --- a/tools/please_go/generate/generate.go +++ b/tools/please_go/generate/generate.go @@ -444,6 +444,7 @@ func (g *Generate) ruleForPackage(pkg *build.Package, dir string) *Rule { srcs: pkg.GoFiles, module: g.moduleArg, cgoSrcs: pkg.CgoFiles, + cSrcs: pkg.CFiles, compilerFlags: pkg.CgoCFLAGS, linkerFlags: pkg.CgoLDFLAGS, pkgConfigs: pkg.CgoPkgConfig, diff --git a/tools/please_go/generate/rules.go b/tools/please_go/generate/rules.go index 702349e6..eb10d10e 100644 --- a/tools/please_go/generate/rules.go +++ b/tools/please_go/generate/rules.go @@ -8,6 +8,7 @@ type Rule struct { module string srcs []string cgoSrcs []string + cSrcs []string compilerFlags []string linkerFlags []string pkgConfigs []string @@ -15,8 +16,7 @@ type Rule struct { hdrs []string deps []string embedPatterns []string - // TODO(jpoole): handle external test - external, isCMD bool + isCMD bool } func populateRule(r *build.Rule, targetState *Rule) { @@ -26,6 +26,9 @@ func populateRule(r *build.Rule, targetState *Rule) { } else { r.SetAttr("srcs", NewStringList(targetState.srcs)) } + if len(targetState.cSrcs) > 0 { + r.SetAttr("c_srcs", NewStringList(targetState.cSrcs)) + } if len(targetState.deps) > 0 { r.SetAttr("deps", NewStringList(targetState.deps)) }