Skip to content

feat: pass extra compiler arguments from the config file#1243

Closed
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:feat/support_extra_compiler_args
Closed

feat: pass extra compiler arguments from the config file#1243
gennaroprota wants to merge 1 commit into
cppalliance:developfrom
gennaroprota:feat/support_extra_compiler_args

Conversation

@gennaroprota

@gennaroprota gennaroprota commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

This adds support for an extra-compiler-args option (a list of strings whose values are appended verbatim to each translation unit's compile command). It is an escape hatch for compiler flags MrDocs does not model directly.

Changes

  • Source: adjustCommandLine() is extended to append any such arguments as specified in the config file.
  • Golden tests: A new golden test fixture ensures -D<macro_name> reaches the compiler.

Testing

A new golden test includes a config file that adds the command-line argument -DMRDOCS_EXTRA_ARG; the corresponding .cpp file uses that macro to guard a function declaration, and the test checks that the function is included in the XML output.

Documentation

ConfigOptions.json provides the documentation for the new option.

Closes #9.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

✨ Highlights

  • 🧪 New golden tests added

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 80% 88 88 - 3 3 - - -
🛠️ Source 12% 13 13 - 2 - 2 - -
📄 Docs 8% 9 9 - 1 - 1 - -
Total 100% 110 110 - 6 3 3 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • test-files/golden-tests/config/extra-compiler-args/extra-compiler-args.xml (Golden Tests): 79 lines Δ (+79 / -0)
  • docs/mrdocs.schema.json (Docs): 9 lines Δ (+9 / -0)
  • src/lib/ConfigOptions.json (Source): 7 lines Δ (+7 / -0)

Generated by 🚫 dangerJS against 3b6c990

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.16%. Comparing base (c795d5d) to head (3b6c990).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1243   +/-   ##
========================================
  Coverage    83.16%   83.16%           
========================================
  Files           35       35           
  Lines         3660     3660           
  Branches       844      844           
========================================
  Hits          3044     3044           
  Misses         409      409           
  Partials       207      207           
Flag Coverage Δ
bootstrap 83.16% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cppalliance-bot

cppalliance-bot commented Jul 24, 2026

Copy link
Copy Markdown

An automated preview of the documentation is available at https://1243.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-07-24 13:38:52 UTC

@gennaroprota
gennaroprota force-pushed the feat/support_extra_compiler_args branch from 869ca92 to d4d5c50 Compare July 24, 2026 12:42
This adds support for an `extra-compiler-args` option (a list of strings
whose values are appended verbatim to each translation unit's compile
command). It is an escape hatch for compiler flags MrDocs does not model
directly.

Closes cppalliance#9.
@gennaroprota
gennaroprota force-pushed the feat/support_extra_compiler_args branch from d4d5c50 to 3b6c990 Compare July 24, 2026 13:28
@alandefreitas

Copy link
Copy Markdown
Collaborator

#9 (comment)

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

Successfully merging this pull request may close these issues.

additional Executor arguments from YML

3 participants