Improve clang-analyzer build time
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 21 Aug 2019 03:52:58 +0000 (05:52 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 22 Aug 2019 13:57:55 +0000 (15:57 +0200)
The tests for selection and utility modules take a long time to
link, so these are moved earlier in the CMake so that linking
will start sooner.

Change-Id: I2fb50515d8ffe5f93e0bcf13c6a780cb5725aa3e

src/gromacs/CMakeLists.txt

index 6e76dfa7d023dc0aa8044eb31e2278496e7a98c4..01377ff1b0f0df55c187a5139d64935f26f0ea04 100644 (file)
@@ -82,6 +82,11 @@ function (gmx_write_installed_header_list)
     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/installed-headers.txt "${_list}")
 endfunction()
 
+# Add these contents first because linking their tests can take a lot
+# of time, so we want lots of parallel work still available after
+# linking starts.
+add_subdirectory(utility)
+# Add normal contents
 add_subdirectory(gmxlib)
 add_subdirectory(mdlib)
 add_subdirectory(applied_forces)
@@ -109,7 +114,6 @@ add_subdirectory(taskassignment)
 add_subdirectory(timing)
 add_subdirectory(topology)
 add_subdirectory(trajectory)
-add_subdirectory(utility)
 add_subdirectory(swap)
 add_subdirectory(essentialdynamics)
 add_subdirectory(pulling)
@@ -205,10 +209,14 @@ else()
     add_library(libgromacs ${LIBGROMACS_SOURCES})
 endif()
 
-add_subdirectory(fileio)
+# Add these contents first because linking their tests can take a lot
+# of time, so we want lots of parallel work still available after
+# linking starts.
 if (NOT GMX_BUILD_MDRUN_ONLY)
     add_subdirectory(selection)
 endif()
+# Add normal contents
+add_subdirectory(fileio)
 
 # Suppress a warning about our abuse of t_inputrec
 gmx_source_file_warning_suppression(mdtypes/inputrec.cpp -Wno-class-memaccess HAS_NO_CLASS_MEMACCESS)