Skip to content

Created abstraction layer on top of qnx/linux config - #119

Open
armando-martins wants to merge 3 commits into
eclipse-score:mainfrom
armando-martins:ajfm_separated_linux_qnx_configs
Open

Created abstraction layer on top of qnx/linux config#119
armando-martins wants to merge 3 commits into
eclipse-score:mainfrom
armando-martins:ajfm_separated_linux_qnx_configs

Conversation

@armando-martins

@armando-martins armando-martins commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Now the "cc_toolchain_config" is not duplicated in both qnx and linux, and instead there is an abstraction layer that handles the general config, and the specific ones are still inside linux/qnx folder

  • Changed location of "shared" to a specific folder
  • Created "templates/cc_toolchain_config.bzl.template" that is the base of the toolchain itself, and now the "templates/linux/cc_toolchain_config.bzl.template" and "templates/qnx/cc_toolchain_config.bzl.template" only contains the specific features of that OS.
  • Changed "templates/linux/cc_toolchain_flags.bzl.template" and "templates/qnx/cc_toolchain_flags.bzl.template" to only have the specific flags of each toolchain
  • Created "templates/cc_toolchain_flags.bzl.template" with the common flags that are independent of the target toolchain

With this PR we can adapt our toolchain to new targets without make changes inside "templates/cc_toolchain_config.bzl.template" or "templates/cc_toolchain_flags.bzl.template", just needing to add the specific features and flags for that target, and adapt the "rules/gcc.bzl" to support the new one.

@armando-martins
armando-martins force-pushed the ajfm_separated_linux_qnx_configs branch 4 times, most recently from c0d3da1 to 917279a Compare August 13, 2026 14:47
Now the "cc_toolchain_config" is not duplicated in both
qnx and linux, and instead there is an abstraction layer
that handles the general config, and the specific ones are still
inside linux/qnx folder

When adding a new OS, for example, we just need to create the specific
folder with the "cc_toolchain_config.bzl.template", the needed flags and the
BUILD file. Base "cc_toolchain_config" is now ready to not need changes in there
when updating qnx/linux toolchain, or creating a new one.
@armando-martins
armando-martins force-pushed the ajfm_separated_linux_qnx_configs branch from 917279a to 13d1c73 Compare August 13, 2026 14:53
Created a layer of abstraction with the flags that are common to all toolchains
Inside linux and qnx folders we have only the specific ones.
Common flags are sent to the specific toolchain via arguments of "make_features"
and the specific ones are loaded directly inside specific toolchain
previously we were generating the config/flags for all the toolchains
available in the project.
Now we isolate each one of those, and the toolchain config/flags
generated are now only the ones that are needed for a certain build,
so when we run qnx toolchain, we dont generate the linux artifacts
and vice versa.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant