diff --git a/chore/_xtool/llcppsymg/llcppsymg.go b/chore/_xtool/llcppsymg/llcppsymg.go index 0597e6a6..03614a9b 100644 --- a/chore/_xtool/llcppsymg/llcppsymg.go +++ b/chore/_xtool/llcppsymg/llcppsymg.go @@ -64,11 +64,19 @@ func main() { jsonData, err := json.MarshalIndent(symbolInfo, "", " ") check(err) - // 写入文件 fileName := "llcppg.symb.json" err = os.WriteFile(fileName, jsonData, 0644) check(err) + absJSONPath, err := filepath.Abs(fileName) + check(err) + + config.JSONPath = absJSONPath + updatedCfgData, err := json.MarshalIndent(config, "", " ") + check(err) + + err = os.WriteFile(cfgFile, updatedCfgData, 0644) + check(err) } func check(err error) { diff --git a/chore/llcppg/types/types.go b/chore/llcppg/types/types.go index 2e39bbdd..91ac3a5b 100644 --- a/chore/llcppg/types/types.go +++ b/chore/llcppg/types/types.go @@ -23,4 +23,5 @@ type Config struct { Libs string `json:"libs"` Include []string `json:"include"` TrimPrefixes []string `json:"trimPrefixes"` + JSONPath string `json:"jsonPath"` }