Fix double linkage for tests
authorRoland Schulz <roland@utk.edu>
Tue, 16 Sep 2014 00:08:19 +0000 (20:08 -0400)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 18 Sep 2014 08:03:41 +0000 (10:03 +0200)
commit82fdaa94e91c53ad79b8cca936ee35f18732f9cd
treebfd4076ea8ce8ae511e0e78c4664ed3834c59eab
parent2c28d95ed35f89aee53a3883a1b6dc43b52af41e
Fix double linkage for tests

cmake automatically adds libraries required by a required library to the
exe linker flags. If the same dependent library is also added for the exe
and it is listed first for the exe, cmake links twice for static libs
(for a cyclic dependency it would be required and cmake can't know).
Under certain conditions (e.g. ICC 15 with static libraries and offload
enabled) this can cause linker errors. We don't have a cyclic dependency
and thus by listing libgromacs after testutils we avoid the potential
problematic double linking. Also fixes that TESTUTILS_LIBS contains
the transitive dependencies, because that is not necessary (they are anyhow
added automatically).

Change-Id: I0327b2dba0538a2c6652c484fd7be7ae4a6cfb5b
src/testutils/CMakeLists.txt
src/testutils/TestMacros.cmake