- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'd like to set a #define in my code (or most likely -D to the compiler) based on an environment variable. It will be used by our continuous integration system to set version that should be compiled into the product.
Is there any way to do this? I'm using PSoC Creator 4.0 together with a PSoC 4 (4200 series).
Thanks, Jacob
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is not a means to do this in the cyprjmgr tool. To support this flexibility, I would suggest you to choose to export your project as a Makefile and use that file as the basis for your build system. Export to Makefile is a new feature available in PSoC Creator 4.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume that on your CI system you are calling the compile process via the command line? In that case, you can hand in a define to the compiler via -D.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
on the CI system I'm building by calling cyprjmgr like this: "c:\Program Files (x86)\Cypress\PSoC Creator\4.0\PSoC Creator\bin\cyprjmgr.exe" -wrk WORKSPACE.cywrk -prj "PROJECT" -build
Can I pass in -D defines to that?
Thanks, Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To get information on the parameters of the command line compilation, type this command:
“[Path of installation folder of Creator]\[version of Creator]\PSoC Creator\bin\cyprjmgr.exe" -h
For example, the final command for a 64-bit system could be:
"C:\Program Files (x86)\Cypress\PSoC Creator\4.0\PSoC Creator\bin\cyprjmgr.exe" -h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I can't find any option to cyprjmgr that suits my need. Any idea?
Thanks, Jacob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is not a means to do this in the cyprjmgr tool. To support this flexibility, I would suggest you to choose to export your project as a Makefile and use that file as the basis for your build system. Export to Makefile is a new feature available in PSoC Creator 4.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
However, you can open the project in PSoC Creator and set the necessary #defines in the project build settings. These will be used when building the project via prjmgrtool.exe-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Opening the project in PSoC Creator isn't really feasible in an automated build system.
I will try the Makefile way.
Thanks, Jacob