AKEngels / CAST

Conformational Analysis and Search Tool
GNU Lesser General Public License v3.0
1 stars 5 forks source link

RFC: Compile CAST unit tests with the same build flags #40

Open schaerfo opened 3 years ago

schaerfo commented 3 years ago

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 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.

Thoughts?

mrnicegyu11 commented 3 years ago

go ahead ! 👍

schaerfo commented 3 years ago

I have implemented this for the CMake build system. Unfortunately, I am currently not sure how this could be done for Premake as well.