----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57052/#review167109 -----------------------------------------------------------
cmake/CompilationConfigure.cmake (line 298) <https://reviews.apache.org/r/57052/#comment239242> Joseph Wu brought up a point that this _may_ not update the output file `config.hpp` on each invocation of CMake, as `config.hpp.in` itself doesn't change. However, I double checked and with CMake 3.7.1 at least, it does indeed behave as I expected. Each direction invocation of `cmake` reruns the CMake command `configure_file` which has different input due to `BUILD_TIME` changing, and so updates the file. While the semantics _slightly_ change from 'compilation time' to 'configuration time', we agree this is acceptable. support/gitignore (line 36) <https://reviews.apache.org/r/57052/#comment239243> Ah, note to myself: update the output to go only into `build` instead of into `${CMAKE_SOURCE_DIR}`. - Andrew Schwartzmeyer On Feb. 25, 2017, 12:31 a.m., Andrew Schwartzmeyer wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/57052/ > ----------------------------------------------------------- > > (Updated Feb. 25, 2017, 12:31 a.m.) > > > Review request for mesos, Alex Clemmer, Joseph Wu, and Michael Park. > > > Bugs: MESOS-7172 > https://issues.apache.org/jira/browse/MESOS-7172 > > > Repository: mesos > > > Description > ------- > > Commit c7fc1377b introduced a bug that prevented any incremental > recompilation. By defining the `BUILD_TIME` in `MESOS_CPPFLAGS`, > every build was seen as having a root dependency (the flags) > changed, causing a rebuild of every single file (including > dependencies). > > This patch introduces a CMake `configure_file` directive which > takes in `config.hpp.in` and emits `config.hpp` with the > `BUILD_TIME`, `BUILD_DATE`, and `BUILD_USER` variables defined. > It also sets `HAVE_CONFIG_H` which `build.cpp` uses to `#include` > the configuration file. The result is that the date, time, and user > are set at the point of configuration (invocation of CMake) instead > of at build, thus allowing for incremental rebuilds. > > As `config.hpp` is auto-generated by the CMake configuration, > it is ignored by Git. > > > Diffs > ----- > > cmake/CompilationConfigure.cmake ed727e6a679e718f88f158faba9fecc3061ac700 > src/common/build.cpp 090b59fb22bfc00516d65f501f8f18cd85a5b4cd > src/common/config.hpp.in PRE-CREATION > support/gitignore 90b6697d19a5e0a68805b23b587b362731a1df25 > > Diff: https://reviews.apache.org/r/57052/diff/ > > > Testing > ------- > > cmake; make && make check on Linux > cmake; VS build stout-tests and mesos-tests, then repeat and see no > compilation take place a second time. Also support\windows-build.bat twice. > > > Thanks, > > Andrew Schwartzmeyer > >