You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "xuxin930 (via GitHub)" <gi...@apache.org> on 2024/05/29 09:43:50 UTC
[PR] cmake:bugfix CMake compilation options settings should not use strings [nuttx]
xuxin930 opened a new pull request, #12423:
URL: https://github.com/apache/nuttx/pull/12423
## Summary
### Issue
> [!CAUTION]
> when repeatedly enabling and disabling string-controlled configurations,
> the generated toolchain configuration may be incorrect.
```bash
# init a cxx config
cmake -B build -DBOARD_CONFIG=some-config-disable-cxx-exception
# menuconfig enable CONFIG_CXX_EXCEPTION
cmake --build build -t menuconfig
# re build or re menuconfig
cmake --build build
```
> [!NOTE]
> Initialization compilation configuration
> 
> [!WARNING]
> After the modification
> we can tell that it has not taken effect
> 
### Reason
I found that this was because the compilation options we used **STRINGS** to control in the `Toolchain file` did not work as expected.
### Solution
I plan to remove all **String-controlled** compile options and call `add_compile_options()` instead.
for the toolchain linked library that needs to be found in the `platform.cmake`, the `execute_process` command is executed in the `congfigure` stage. at this time, the generator expression will not be parsed.
so i use the currently configured options and regex parse the generator expression.
## Impact
## Testing
CI build
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] cmake:bugfix CMake compilation options settings should not use strings [nuttx]
Posted by "xuxin930 (via GitHub)" <gi...@apache.org>.
xuxin930 commented on PR #12423:
URL: https://github.com/apache/nuttx/pull/12423#issuecomment-2137006511
Hi @anchao : ) , could you please help review if this modification is appropriate?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] cmake:bugfix CMake compilation options settings should not use strings [nuttx]
Posted by "xuxin930 (via GitHub)" <gi...@apache.org>.
xuxin930 commented on code in PR #12423:
URL: https://github.com/apache/nuttx/pull/12423#discussion_r1619716423
##########
CMakeLists.txt:
##########
@@ -622,9 +622,8 @@ if(NOT CONFIG_ARCH_SIM)
# TODO: nostart/nodefault not applicable to nuttx toolchain
target_link_libraries(
- nuttx
- PRIVATE ${NUTTX_EXTRA_FLAGS} -Wl,--script=${ldscript} -Wl,--start-group
- ${nuttx_libs} ${nuttx_extra_libs} -Wl,--end-group)
+ nuttx PRIVATE -Wl,--script=${ldscript} -Wl,--start-group ${nuttx_libs}
Review Comment:
> Why ${NUTTX_EXTRA_FLAGS} was removed?
This NUTTX_EXTRA_FLAGS is a compile option set in the configure stage. I think this is redundant when linking.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] cmake:bugfix CMake compilation options settings should not use strings [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on code in PR #12423:
URL: https://github.com/apache/nuttx/pull/12423#discussion_r1618852245
##########
CMakeLists.txt:
##########
@@ -622,9 +622,8 @@ if(NOT CONFIG_ARCH_SIM)
# TODO: nostart/nodefault not applicable to nuttx toolchain
target_link_libraries(
- nuttx
- PRIVATE ${NUTTX_EXTRA_FLAGS} -Wl,--script=${ldscript} -Wl,--start-group
- ${nuttx_libs} ${nuttx_extra_libs} -Wl,--end-group)
+ nuttx PRIVATE -Wl,--script=${ldscript} -Wl,--start-group ${nuttx_libs}
Review Comment:
Why ${NUTTX_EXTRA_FLAGS} was removed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] cmake:bugfix CMake compilation options settings should not use strings [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #12423:
URL: https://github.com/apache/nuttx/pull/12423
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org