Alternatively, the preprocessor macro could be defined in the unit test source files before including the headers that rely on it (currently energy_int_aco.h and exciton_breakup.h). Then, the CAST source files can be compiled into a static library which can subsequently be linked into the executables for CAST and the unit tests.
Currently, when CAST's unit tests are compiled, the preprocessor definition
GOOGLE_MOCK
is added via the compiler command line (see https://github.com/AKEngels/CAST/blob/1ba3dd0ae828cc07765d25de62dd3ec55f67e850/optional_files/premake5.lua#L106). This essentially forces CAST to be recompiled in its entirety for unit tests, wasting some time.Alternatively, the preprocessor macro could be defined in the unit test source files before including the headers that rely on it (currently
energy_int_aco.h
andexciton_breakup.h
). Then, the CAST source files can be compiled into a static library which can subsequently be linked into the executables for CAST and the unit tests.Thoughts?