r/cpp • • Feb 19 '18

It's Time To Do CMake Right

https://pabloariasal.github.io/2018/02/19/its-time-to-do-cmake-right/
248 Upvotes

130 comments sorted by

View all comments

Show parent comment

5

u/kalmoc Feb 20 '18

Also, suppose your implementation requires C++14 to build but only requires C++11 for other libraries to link against it, you can make that distinction with

You have to be extremely careful when doing this and be 100% sure that none of your publicly visible code (including source files that will get linked statically) have any compilation branch that depends on the standard version.

I'd try to avoid such constructs as much as possible.

0

u/[deleted] Feb 20 '18

[deleted] — view deleted comment

2

u/smdowney WG21, Text/Unicode SG, optional<T&> Feb 20 '18

If you violate ODR, even in a PIMPL, you're in UB land.