Compiler flags are not passed to some module targets
Summary
Each OBJECT sub-target should call
gmx_target_compile_options(${name})
target_compile_definitions(${name} PRIVATE HAVE_CONFIG_H)
to correctly set up compilation flags. This was omitted for the following modules:
-
options
(release-2023) -
pulling
(release-2023) -
taskassignment
(release-2023) -
energyanalysis
(main)
Most of the "lost" flags are warning-related, but there are also some G++ optimizer hints.
Besides, during the compartmentalization of pulling
(f058d2fb), OpenMP-enabling flags were lost as well, leading to some potential performance degradation (we're parallelizing some force calculation carried out over all local atoms).
Possible fixes
Adding the necessary flags manually is straightforward.
To discuss: perhaps we need some guard to prevent it from happening again?
E.g., set -DGMX_CUSTOM_FLAGS_ARE_PASSED
in gmx_target_compile_options
, and then check for it in gmxpre.h
?