DNedic/most_commented_embedded_cmakelists

Using the most_commented_embedded_cmakelists repository

Closed this issue · 3 comments

fivdi commented

@DNedic Thank you very much for creating this repository and the corresponding article. It works well for me and is very helpful. Feel free to close this issue as I'm not actually reporting an issue, just thanking you 😄

For those totally new to CMake, here are the commands that I used to give the repository a quick try:

git clone https://github.com/DNedic/most_commented_embedded_cmakelists.git
cd most_commented_embedded_cmakelists
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../arm-none-eabi-gcc.cmake ..
make

Here is the output of cmake:

-- The C compiler identification is GNU 12.2.1
-- The CXX compiler identification is GNU 12.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/arm-none-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/src/most_commented_embedded_cmakelists/build

Here is the output of make (there are a few warnings but all is ok):

Scanning dependencies of target Drivers
[  7%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c.obj
[ 14%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c.obj
[ 21%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c.obj
[ 28%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c.obj
[ 35%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c.obj
[ 42%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c.obj
[ 50%] Building C object Drivers/CMakeFiles/Drivers.dir/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c.obj
[ 57%] Linking C static library libDrivers.a
[ 57%] Built target Drivers
Scanning dependencies of target most_commented_embedded_cmakelists.elf
[ 64%] Building C object CMakeFiles/most_commented_embedded_cmakelists.elf.dir/Core/Src/main.c.obj
[ 71%] Building C object CMakeFiles/most_commented_embedded_cmakelists.elf.dir/Core/Src/stm32f1xx_hal_msp.c.obj
[ 78%] Building C object CMakeFiles/most_commented_embedded_cmakelists.elf.dir/Core/Src/stm32f1xx_it.c.obj
[ 85%] Building C object CMakeFiles/most_commented_embedded_cmakelists.elf.dir/Core/Src/system_stm32f1xx.c.obj
[ 92%] Building ASM object CMakeFiles/most_commented_embedded_cmakelists.elf.dir/startup_stm32f103xb.s.obj
[100%] Linking C executable most_commented_embedded_cmakelists.elf
/home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-closer.o): in function `_close_r':
(.text._close_r+0xc): warning: _close is not implemented and will always fail
/home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-lseekr.o): in function `_lseek_r':
(.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
/home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-readr.o): in function `_read_r':
(.text._read_r+0x10): warning: _read is not implemented and will always fail
/home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: /home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/lib/thumb/v7-m/nofp/libc_nano.a(libc_a-writer.o): in function `_write_r':
(.text._write_r+0x10): warning: _write is not implemented and will always fail
/home/pi/opt/xpack-arm-none-eabi-gcc-12.2.1-1.2/bin/../lib/gcc/arm-none-eabi/12.2.1/../../../../arm-none-eabi/bin/ld: warning: most_commented_embedded_cmakelists.elf has a LOAD segment with RWX permissions
   text	   data	    bss	    dec	    hex	filename
   3284	     20	   1572	   4876	   130c	most_commented_embedded_cmakelists.elf
[100%] Built target most_commented_embedded_cmakelists.elf

I'm happy the repo and the article were helpful to you, I will add build instructions to the README 🙂

@fivdi I have added the commands to build the project to the README, take a look, these ones don't depend on Make and are only using CMake commands. :)

fivdi commented

Nice :) The commands look good to me.