qb icon indicating copy to clipboard operation
qb copied to clipboard

Add compiler/linker flags (OS-specific)

Open codecat opened this issue 5 years ago • 0 comments

We need a way to allow setting arbitrary compiler and linker flags, on an OS-specific basis.

For example, a problem arises if we have this command: (just an example, this isn't actual syntax)

$ qb --cflag "-O3"

Which will work okay on gcc/clang, but won't work on MSVC.

I think a lot of common flags can be added natively with the proper abstractions built-in (the -O3 example above already can be done with --optimize), but for the few cases that we do want to set flags, it could be nice to do so.

Perhaps this would best be done in the config file alone. Here's a possible thought:

[windows]
cflags = "/O2"

[linux]
cflags = "-O3"

But this raises some questions about what we can put exactly in these [windows] and [linux] blocks, which should probably be limited in scope to avoid confusion. Maybe we can even be more explicit in our intent: [compiler.windows].

codecat avatar Jul 26 '20 14:07 codecat