foundationdb/fdbclient/LinkTest.cpp
Lukas Joswiak 618f8455c4 Add test executables to catch missing symbols
Currently, we have code in different folders like `flow/` and `fdbrpc/`
that should remain isolated. For example, `flow/` files should not
include functionality from any other modules. `fdbrpc/` files should
only be able to include functionality from itself and from `flow/`.
However, when creating a shared library, the linker doesn't complain
about undefined symbols -- this only happens when creating an
executable. Thus, for example, it is possible to forward declare an
`fdbclient` function in an `fdbrpc` file and then use it, and nothing
will break (when it should, because this is illegal).

This change adds dummy executables for a few modules (`flow`, `fdbrpc`,
`fdbclient`) that will cause a linker error if there are included
symbols which the linker can't resolve.
2022-07-06 14:49:33 -07:00

9 lines
371 B
C++

// When creating a static or shared library, undefined symbols will be ignored.
// Since we want to ensure no symbols from other modules are used, each module
// will create an executable so the linker will throw errors if it can't find
// the declaration of a symbol. This class defines a dummy main function so the
// executable can be built.
int main() {
return 0;
}