-
Notifications
You must be signed in to change notification settings - Fork 7.7k
-
There are still many Arduino board variants with a dash in the name. For example, "ttgo-lora32-v1" or "lolin32-lite".
In CMakeLists.txt, this variant name is capitalized and then a macro -DARDUINO_${idf_target_caps}_DEV
is defined. However, the C preprocessor does not like macro names with dashes. According to the documentation : "An identifier is the same as an identifier in C: any sequence of letters, digits, or underscores, which begins with a letter or underscore."
So, my suggestion is to replace the dashed (-) with an underscore (_) in the macro definition. This could be implemented in the CMakeLists.txt file as :
string(REPLACE "-" "_" idf_target_for_macro "${idf_target_caps}") target_compile_options(${COMPONENT_TARGET} PUBLIC ... -DARDUINO_${idf_target_for_macro}_DEV ...
I already made some tests, and it seems to work. Does someone see a problem with this idea? If no, I would be happy to propose a pull request with this change.
Note that this problem was also addresses in PlatformIO : platformio/platform-espressif32#81
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 3 replies
-
Any feedback to this @SuGlider / @me-no-dev?
Beta Was this translation helpful? Give feedback.
All reactions
-
Shall I create an issue from this discussion and offer a Pull Request?
Beta Was this translation helpful? Give feedback.
All reactions
-
yes, please do so :)
Beta Was this translation helpful? Give feedback.
All reactions
-
OK. See issue #7499.
Beta Was this translation helpful? Give feedback.
All reactions
-
and PR #7500
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 1