You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/29 06:49:12 UTC

[GitHub] [incubator-nuttx] protobits opened a new pull request, #3704: Migrate build system to CMake

protobits opened a new pull request, #3704:
URL: https://github.com/apache/incubator-nuttx/pull/3704

   ## Summary
   
   This is an incomplete work in progress. The PR is against a separate branch so this can eventually be merged and then finished incrementally on that branch.
   
   Note that this depends on accompanying apps/ change (which I have in my fork's cmake branch: [master..releases/cmake compare link](https://github.com/apache/incubator-nuttx-apps/compare/master...protobits:releases/cmake)).
   
   Currently this work on limited host/target platforms but has most features supported. It mainly needs testing before moving on to other platforms. If you want to contribute, please let me know.
   
   ## Some changes to mention
   
   1. Since the goal is to allow for out-of-tree builds, the context step does not create symlinks inside source tree, but in build directory. Include path is extended to expose this as expected
   2. Debug/Release flags are handled via CMAKE_BUILD_TYPE as expected, not from config options (relevant options are still present on Kconfig, this would eventually be removed)
   3. APPDIR is taken from cmake command line, not from config
   4. `CONFIG_HOST_*` is received via environment variables from CMake
   5. Various cmake `nuttx_*` functions are defined for handling typical build setups
   6. apps/Kconfig is no longer build-time generated but it is now a static file
   
   ## TODO
   
   The following are not yet addressed
   
   - kernel/~protected~ build: don't have a board to test it
   - other arch/boards: only sim and one board supported right now
   - custom boards (currently disabled inclusion of boards/dummy/Kconfig)
   - Complete removal of optimization flags from Kconfig, this is handled via CMAKE_BUILD_TYPE
   - ~Support module building (extend nuttx_add_application to take a symbol)~ update all apps to include MODULE keyword back
   - export: probably needs redesign using cmake (provide one with current behavior for now)
   - Add a flash target (debug also?), and other useful ones
   - how to deal with apps building host code? in CMake this would be an external project but this doesn't seem to be the best option
   - Perform extensive testing on other target and host platforms
   - Document the build system under Documentation/ (design and how to add board/arch/app)
   - macOS: requires GNU toolchain to create ELF binaries. this complicates build since a different toolchain is needed for only part of the build. ideally we would use this toolchain for the complete build but it is not certain that this is possible. will need to look into further: currently i'm linking a static lib using standard toolchain and then create the elf binary with elf-gcc. This needs to be tested.
   
   ## Conversion progress
   
   This is how far I got the conversion, which allows most sim configs to build. 
   
   ### Apps
   
   - [x] apps/builtin
   - [x] apps/canutils
   - [ ] apps/examples
     - [ ] apps/examples/audio_rttl: depends on external Make.defs from SDK. would need a working config to test this
     - [ ] apps/examples/nxflat: need help understanding this
     - [ ] apps/examples/thttpd
     - [x] rest
   - [x] apps/fsutils
   - [x] apps/graphics
   - [x] apps/gpsutils
   - [ ] apps/import: what is the purpose of this?
   - [x] apps/industry
   - [x] apps/interpreters
   - [x] apps/modbus
   - [ ] apps/netutils
     - [ ] apps/netutils/thttpd
     - [x] rest
   - [x] apps/nshlib
   - [ ] apps/platform
   - [x] apps/system
   - [ ] apps/testing
     - [ ] apps/testing/ltp
     - [x] rest 
   - [x] apps/tools
   - [ ] apps/wireless
     - [ ] apps/wireless/nimble
     - [x] rest
   
   ### NuttX
   
   - [ ] nuttx/arch
     - [x] nuttx/arch/arm/src/armv7-m
     - [x] nuttx/arch/arm/src/common
     - [x] nuttx/arch/arm/src/stm32
     - [x] nuttx/arch/sim
     - [ ] rest
   - [ ] nuttx/audio
   - [x] nuttx/binfmt
   - [ ] nuttx/boards
     - [x] nuttx/boards/sim/sim/sim (tested: nsh)
     - [x] nuttx/boards/arm/stm32/stm32f103-minimum (built: nsh)
     - [x] nuttx/boards/arm/stm32/stm32f4discovery (built: nsh, ostest passed)
     - [ ] rest
   - [x] nuttx/crypto
   - [x] nuttx/drivers
   - [x] nuttx/fs
   - [x] nuttx/graphics
   - [x] nuttx/libs
     - [x] nuttx/libs/libc
     - [x] nuttx/libs/libdsp
     - [x] nuttx/libs/libnx
     - [x] nuttx/libs/libxx
   - [x] nuttx/mm
   - [x] nuttx/net
   - [x] nuttx/openamp
   - [x] nuttx/sched
   - [x] nuttx/syscall: need help understanding how to handle this
   - [ ] nuttx/tools: only basic binaries for now, this directory is quite messy. it is hard to know how to handle each tool/script
   - [x] nuttx/video
   - [x] nuttx/wireless
   
   ## Impact
   
   Major, this should probably be part of a major NuttX release. 
   
   ## Testing
   
   Boards currently building, on macOS and Linux:
   
   - sim
   - stm32f4discovery
   
   ### How to test
   
   From within `nuttx/`. Configure:
   
       cmake -B build -DNUTTX_BOARD=sim/sim/sim -DNUTTX_CONFIG=nsh -GNinja
   
   This uses ninja generator (install with `sudo apt install ninja-build`). To build:
   
       cmake --build build
   
   menuconfig:
   
       cmake --build build -t menuconfig
   
   


-- 
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


[GitHub] [incubator-nuttx] anchao commented on pull request #3704: Migrate build system to CMake

Posted by GitBox <gi...@apache.org>.
anchao commented on PR #3704:
URL: https://github.com/apache/incubator-nuttx/pull/3704#issuecomment-1181339622

   Hi @protobits ,
   
   Do you have any commits that support cmake for the apps directory? I would like to continue your great work to finish the cmake support


-- 
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


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3704: Migrate build system to CMake

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #3704:
URL: https://github.com/apache/incubator-nuttx/pull/3704#issuecomment-1222775940

   let's track this work in https://github.com/apache/incubator-nuttx/pull/6718


-- 
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


[GitHub] [incubator-nuttx] xiaoxiang781216 closed pull request #3704: Migrate build system to CMake

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 closed pull request #3704: Migrate build system to CMake
URL: https://github.com/apache/incubator-nuttx/pull/3704


-- 
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