Motivation: Some libraries, e.g. Eigen have ABI that depends on compiler switches.
Question: could users of this library somehow encode this behavior so that if you try to link components compiled with different compiler switches you get a linker error.
So if it is not clear why I am asking about:
Alice the library developer builds her (not header only library) with no special compiler flag and exposes Eigen in her API.
Bob the library consumer compiles with AVX2 enabled, he also uses Eigen in his code. He uses Alice library.
Bob gets crashes at runtime.
Can Alice prevent her library linking in Bob's application? Assume that Alice knows to detect ABI mismatch using preprocessor macros that affect Eigen ABI.
note: I am fine with using C++20 or C++23 solutions if implemented in compilers.