
I believe however that this is not the case for most people. Of course, this extends the problem if you are building multiple binaries, as your libraries will be compiled multiple times, too. This way, Mbed will not be compiled separately for that library. However, if you are building a single binary, I would recommend declaring your libraries as INTERFACE libraries too. I did not try out the mbed_create_distro(), but it seems to be a workaround for the issue if you are actually building multiple binaries. Mbed is compiled as an CMake INTERFACE library, which leads to the issue of recompilation of Mbed for each non- INTERFACE target. It seems that the discussion has moved to another direction, but let me try to address the original issue.Īs mentioned by Ladislas, static Mbed library is not yet supported. The same project built under Linux shows correct dirnames, as supplied in add_subdirectory(path binary_path).Ĭan someone confirm? which OS are you using? Total Static RAM memory (data + bss): 46288(+46288) bytes
CMAKE GLOB ADD LIBRARY WINDOWS
I found some weird behaviour under windows cmake: the obj files are put in strange directory names, which are also used in the compile statistics: - built: D:/Projects/Sn/LocalGit/Mbed6-Projects/apps/lvgl8-ST7735/cmake_build/STM32F407VE_BLACK/release/GCC_ARM/lvgl8-ST7735.hex Maybe it will work also that mbed-os is included in a mbed-os-static lib to build a static lib I remember that you also had this problem with an external mbed-os directory. The mbed-tools compile command needs also the path to the mbed-os dir: mbed-tools compile -mbed-os-path.

With the Mbed generated CMakeLists.txt, cmake will complain about the outside directory, therefore you have to supply a binary directory in add_subdirectory. This requires you to put the following in your CMakeLists.txt file (the one in the project root folder): add_subdirectory($/mbed-os)

Generally you put your source in subfolders. I’m using mbed-tools and cmake to build projects.
