diff --git a/DEVELOPING.md b/DEVELOPING.md index b4feb46..fa05e70 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -6,7 +6,7 @@ Follow steps below to start developing for `cbuild2cmake`: - [Install Make](https://www.gnu.org/software/make/) - [Install Golang](https://golang.org/doc/install) -- [Install GolangCI-Lint](https://golangci-lint.run/usage/install/#local-installation) +- [Install GolangCI-Lint](https://golangci-lint.run/docs/welcome/install/local/) 2. Clone the repo: `$ git clone https://github.com/Open-CMSIS-Pack/cbuild2cmake.git` diff --git a/pkg/maker/buildcontent.go b/pkg/maker/buildcontent.go index 7a861db..bbdbfd1 100644 --- a/pkg/maker/buildcontent.go +++ b/pkg/maker/buildcontent.go @@ -308,6 +308,7 @@ func ListCompileDefinitions(defines []interface{}, delimiter string) string { key, value := utils.GetDefine(define) pair := key if len(value) > 0 { + value = strings.ReplaceAll(value, ">", "$") pair += "=" + value } definesList = append(definesList, pair) diff --git a/pkg/maker/buildcontent_test.go b/pkg/maker/buildcontent_test.go index 1910e0a..c215fd8 100644 --- a/pkg/maker/buildcontent_test.go +++ b/pkg/maker/buildcontent_test.go @@ -556,4 +556,11 @@ add_dependencies(project.debug+target-executes } assert.Equal("${CMSIS_PACK_ROOT}/Vendor/PackName/1.2.3", cbuild.GetDpackDir()) }) + + t.Run("test escape right angle bracket", func(t *testing.T) { + defines := []interface{}{ + map[string]interface{}{"FOO": "A>B>C"}, + } + assert.Equal("FOO=A$B$C", maker.ListCompileDefinitions(defines, ";")) + }) }