fails to generate project(name C) #387
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#387
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In default examples
projecthas no explicitly used languages, which impliesCandCXXLANGUAGES, but if I set my project to be C only (which is correct), cmake fails to generate it. I think toolchain's internals should be separated from the project completely like VCPKG does.Error log:
CMakeLists.txt:
Which part of your project was being built when you saw those errors? Note that building the toolchain also builds elf2uf2 (which converts the
.elffile that GCC generates into a.uf2file for copying onto your Pico) which is a native (it runs on your computer rather than on your Pico) program written in C++.It breaks before the build process during generation as mentioned in the report. Does this regardlessly of me having add_extra_outputs. The toolchain config should be responsible for providing C++ compiler to build elf2uf2, not the project itself. But even considering that I'm not sure whether elf2uf2 is the root of the problem.
Yeah; fixing this is a bit nasty, because the SDK itself is a CXX project, and reports as such vi ENABLED_LANGUAGES property in cmake. Your project fails, because at the toplevel scope CXX is not a valid language. I had a little play and see that if the SDK doesn't include new_delete.cpp then you are fine, but as I say we can't simply check ENABLED_LANGUAGES as that does contain CXX at this point.
I don't feel strongly enough to expend much effort on it right now, so feel free to post a PR... I guess we could add a CMake build flag at least to say you want nothing to do with C++ assuming it is an actual requirement
See #339 for C99
I guess I'll try to toy with the toolchain later and maybe port tools like elf2uf2 to C then
elf2uf2 is not the problem; that is a separate build and works fine
So it's solely the toolchain that breaks because of undefined languages? It seems like it's quite trivial to use gcc-arm toolchain in place of CMAKE_TOOLCHAIN_FILE, but I'm not sure on how to link the libraries in this case. iirc vcpkg adds directories to CMAKE_FIND_ROOT_PATH in order to be able to use find_package or find_path. Can I do the same separately for pico toolchain and if yes, which dirs should I add?
I manage to solve this by using a variable
PICO_SDK_PURE_Cto removenew_delete.cppfrom the source.In
src/rp2_common/pico_standard_link/CMakeLists.txtreplaceby
And then, in your
CMakeList.txtdefine addset(PICO_SDK_PURE_C 1)beforeinclude(pico_sdk_import.cmake)Worked for me! Thank's a lot @Bolayniuss