btop icon indicating copy to clipboard operation
btop copied to clipboard

[REQUEST] Makefile: Respect $(CXX) if set

Open NexAdn opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

The current makefile doesn't respect a custom CXX variable.

Describe the solution you'd like

I'd like for the build system to respect CXX if set.

Describe alternatives you've considered

None. The alternative is patching the makefile for every custom case which isn't really a nice solution.

Additional context

The fix is quite easy (just replace := with ?= when setting CXX in the makefile). It might be useful when wanting to switch between compiler versions (e.g. to test other compilers) or when trying to do cross-compilation. Support for this can also make testing clang compatibility for #324 easier.

NexAdn avatar Jun 04 '22 19:06 NexAdn

@NexAdn It does respect CXX, but not from the environment only when you use CXX= as a parameter when calling make. This was a deliberate choice in the Makefile. This is because GCC is currently the only compiler with the C++20 support needed to compile btop++. The CXX flag for make is also referenced as a working flag in https://github.com/aristocratos/btop#compilation-linux

Support for this can also make testing clang compatibility for https://github.com/aristocratos/btop/issues/324 easier.

make CXX=clang however, the settings for the C++ library also need to be changed to compile with clang. Regardless, when clang has support for C++20 Ranges, I will add support for clang with the correct flags switched in the Makefile.

aristocratos avatar Jun 05 '22 07:06 aristocratos