Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get CMake graph for custom target #63

Open
tripathiu opened this issue Oct 1, 2022 · 3 comments
Open

Cannot get CMake graph for custom target #63

tripathiu opened this issue Oct 1, 2022 · 3 comments

Comments

@tripathiu
Copy link

tripathiu commented Oct 1, 2022

Hi @multiplemonomials,

Note Editing the original issue as I didn't know it was already fixed 😅

First of all thank you for creating this project. A lot of work that I do depends on mbed-os and their sudden disappearance got a lot of us anxious. Hopefully, this project keeps it alive and even makes it better than the original! 🏆

I want to get the graph of dependency that cmake generates using the following command:

cmake -B build -S . && cmake --graphviz=dot/dot build && dot dot/dot -Tpdf -o dot/dot.pdf

But I get the following error for my custom target...

-- mbedos found: /home/triutkarsh/.local/opt/mbed-os-src
'mbed-tools' 'configure' '-t' 'GCC_ARM' '-m' 'CUSTOM_TARGET' '-o' '/home/triutkarsh/firmware/build' '-b'
 'develop' '--mbed-os-path' '/home/triutkarsh/.local/opt/mbed-os-src'
mbed_config.cmake has been generated and written to '/home/triutkarsh/firmware/build/mbed_config.cmake'
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter 
-- Checking for Python package intelhex -- found
-- Checking for Python package prettytable -- found
-- Checking for Python package future -- found
-- Checking for Python package jinja2 -- found
-- Checking for Python package mbed_tools -- found
CMake Error at /home/triutkarsh/.local/opt/mbed-os-src/tools/cmake/mbed_generate_configuration.cmake:21 (messa
ge):
  You must define MBED_TARGET to the Mbed target you wish to build for!
Call Stack (most recent call first):
  /home/triutkarsh/.local/opt/mbed-os-src/tools/cmake/app.cmake:42 (include)
  CMakeLists.txt:33 (include)


-- Configuring incomplete, errors occurred!

Thanks and cheers. 🍻

@tripathiu tripathiu changed the title A better build system Cannot get CMake graph for custom target Oct 1, 2022
@multiplemonomials
Copy link
Collaborator

Glad that you're getting some use out of the project!
Oh, this is a pretty easy fix. You just need to pass the name of your target, like:

cmake -DMBED_TARGET=<your target name> -B build -S . && cmake --graphviz=dot/dot build && dot dot/dot -Tpdf -o dot/dot.pdf

See here for the command line build instructions: https://github.com/mbed-ce/mbed-os/wiki/Project-Setup:-Command-Line

However, I will say that I don't have terribly polished support for custom targets at this point (see #48). I can try to set up some docs for you to use in the next week or two though.

@multiplemonomials
Copy link
Collaborator

And regarding your original question, yes indeed I have almost completely gotten rid of interface targets in Mbed CE. The core mbed code is compiled into a single library (well, two possible versions, mbed-baremetal and mbed-os). And optional libraries are handled as STATIC libraries, not INTERFACE or OBJECT. This means that no code should ever get compiled more than once!

@tripathiu
Copy link
Author

Thank you for your response. I guess it was my cmake configuration causing the issue. I tried it with a blank project and it works.

optional libraries are handled as STATIC libraries, not INTERFACE or OBJECT

That's really awesome. I would like to explore a little more mbed-ce. Seems like there is already a lot of work put into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants