Replies: 1 comment 1 reply
-
@scaprile of the three things you've tried, I think the third is correct:
I tested this by adding #if FOO_BAR == 1
#error FOO_BAR==1
#endif to the top of examples/usercmodule/cexample/examplemodule.c Compiled with
It does not print the Then I added target_compile_definitions(usermod_cexample INTERFACE
FOO_BAR=1
) to the
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a bunch of C modules that I would like to use from micropython. Each of these modules has configuration options usually passed with -D on the compiler.
I'm not fond of cmake and not versed in it, I tried with what I could grasp:
But no luck. My modules are built with a bunch of other files and the only definitions I see on the build command are those from the port -common and the extmod .cmake files. Not mine...
I attach a simple example with 2 Makefiles, one for the ESP32 and other for the RP2 ports. Both build OK if I remove the check for those definitions presence... and of course I don't see any of them in the generated build command.
test.zip
The ESP32 example uses Docker to get the IDF image with everything installed. The RP2 example requires git and cmake. Both run on Linux.
I'd like to keep build flags inside user modules so they build with any port... of course.
Beta Was this translation helpful? Give feedback.
All reactions