es-ude / EmbeddedSystemsBuildScripts

Bazel build scripts used for all projects of the embedded systems department
MIT License
4 stars 5 forks source link

Documentation: How do the copts have to be defined together with cpu_frequency_flag() #10

Closed saphieron closed 4 years ago

saphieron commented 5 years ago

Under https://github.com/es-ude/EmbeddedSystemsBuildScripts#macros the copts option is defined with copts = cpu_frequency_flag(),

which presumably defines the CPU frequency. However it is unclear, how that macro call can be extended to be used with other copts. Using the intuitiv step of e.g. copts = cpu_frequency_flag() + "-DDEBUG=1" does raise an error. It is unclear how to use this. Other copts statements however use + to add the different strings.

An example how to extend the copts is required in the documentation.

glencoe commented 5 years ago

Your example fails, because copts expects an array of strings. Also you should see an error message that tells you that the + operator is not defined for the combination of strings and arrays.

copts = cpu_frequency_flag() + ["-DDEBUG=1"]

should work.

Leaving the issue open since having this in the documentation wouldn't hurt.

pixelboehm commented 4 years ago

Added in 299e1d9633b2f9d50b2fe4c35b4632e391068159. If there is still something unclear, reopening this issue may be a good idea.