Skip to content

Commit

Permalink
add expandCfgByName
Browse files Browse the repository at this point in the history
  • Loading branch information
tsingbx committed Dec 11, 2024
1 parent a5ec323 commit 3fc0216
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/llcppcfg/llcppgcfg/cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ func ExpandCFlagsName(name string) ([]string, string) {
return ExpandCflags(originCFlags)
}

func expandCfgByName(name string, cfg *LLCppConfig) {
cfg.Include, cfg.CFlags = ExpandCFlagsName(name)
cfg.Libs = ExpandLibsName(name)
}

func NewLLCppConfig(name string, isCpp bool, expand bool) *LLCppConfig {
cfg := &LLCppConfig{
Name: name,
Expand All @@ -147,12 +152,10 @@ func NewLLCppConfig(name string, isCpp bool, expand bool) *LLCppConfig {
cfg.TrimPrefixes = []string{}
cfg.Cplusplus = isCpp
cfg.Include = []string{}
cfg.Include, _ = ExpandCFlagsName(name)
if expand {
cfg.Include, cfg.CFlags = ExpandCFlagsName(name)
cfg.Libs = ExpandLibsName(name)
return cfg
expandCfgByName(name, cfg)
}
cfg.Include, _ = ExpandCFlagsName(name)
return cfg
}

Expand Down

0 comments on commit 3fc0216

Please sign in to comment.