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

Possible to specify a cross compiler? #329

Open
aka-mj opened this issue Oct 30, 2024 · 1 comment
Open

Possible to specify a cross compiler? #329

aka-mj opened this issue Oct 30, 2024 · 1 comment

Comments

@aka-mj
Copy link

aka-mj commented Oct 30, 2024

Is it possible to specify an alternative compiler path? My project uses its own compiler but clang-uml picks up the compiler installed on the system, which is older and doesn't recognize the newer headers (utility, optional, chrono, ..).

@bkryza
Copy link
Owner

bkryza commented Oct 30, 2024

@aka-mj Typically, compiler path should be set properly in your compile_commands.json as the first argument of each compile command.

If it is, and the compiler is GCC-compatible, you can run clang-uml with --query-driver . argument, which will extract the necessary include paths from the compiler and add them to the compile commands.

If your compile_commands.json for some reason does not have the right compiler, you can pass a custom compiler in the --query-driver option, e.g.:

$ clang-uml --query-driver arm-none-eabi-g++

Furthermore, if this doesn't help, you can manually add or remove compilation flags in the .clang-uml config, e.g.:

add_compile_flags:
  - -I/opt/my_toolchain/include
remove_compile_flags:
  - -I/usr/include

See also here

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