-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Currently, configuring some library/block to use C++11/14 is a bit complex. There are several options:
1-. Native use of CMake. It can require some conditionals for MultiOS
IF(UNIX)
IF(CLANG)
TARGET_COMPILE_OPTIONS(${BII_BLOCK_TARGET} INTERFACE -std=c++11)
....
2-. Use an existing CMake macro, possibly one existing in biicode and retrieved as dependency:
INCLUDE(biicode/cmake/tools)
ACTIVATE_CPP11(INTERFACE ${BII_BLOCK_TARGET})
This one requires one bii find or [requirements] to be written.
PROPOSAL:
From my point of view, it is still a bit complex, so I propose a high level definition, in biicode.conf, something like:
[cpp-std]
c++11 PUBLIC # or c++11 libstdc++...
That would be translated to a cmake variable, and biicode, checking that variable would automatically call something in the line of ACTIVATE_CPP11. Surely we have to check for CMake compile features as solution for this, instead of bare compile options.
Pros:
- Much simpler approach
- Easily deals with propagating usage to consumers
- Might be able to deal with the problem of collisions
- Totally optional, the user can still use the other approaches
Cons:
- It wires the config to the internal ACTIVATE_CPP11 implementation, that might change with new versions of biicode, so changes, improvements, could break something.
Metadata
Metadata
Assignees
Labels
No labels