From: Martin Quinson Date: Fri, 11 Jan 2019 16:34:41 +0000 (+0100) Subject: don't include the git hash in simgrid/config.h X-Git-Tag: v3_22~587 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8c07a3a80c138206837590236841d34a14522a0b don't include the git hash in simgrid/config.h This should speed up incremental rebuilds after cmake runs. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index fb60a44236..98817df26a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -513,8 +513,10 @@ endif() # Avoid triggering a (full) rebuild by touching the files if they did not really change configure_file("${CMAKE_HOME_DIRECTORY}/src/internal_config.h.in" "${CMAKE_BINARY_DIR}/src/internal_config.h.generated" @ONLY IMMEDIATE) +configure_file("${CMAKE_HOME_DIRECTORY}/src/simgrid/version.h.in" "${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated" @ONLY IMMEDIATE) configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated" @ONLY IMMEDIATE) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h) +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/src/simgrid/version.h) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/config.h) file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated) file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated) diff --git a/include/simgrid/config.h.in b/include/simgrid/config.h.in index 6c5d1cdf6c..bbb7aa0355 100644 --- a/include/simgrid/config.h.in +++ b/include/simgrid/config.h.in @@ -14,7 +14,6 @@ #define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@ #define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@ #define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@ -#define SIMGRID_GIT_VERSION "@GIT_VERSION@" #define SIMGRID_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" SG_BEGIN_DECL() diff --git a/src/simgrid/version.h.in b/src/simgrid/version.h.in new file mode 100644 index 0000000000..fa8433b966 --- /dev/null +++ b/src/simgrid/version.h.in @@ -0,0 +1,13 @@ +/* src/simgrid/version.h - internal versionning info */ + +/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + +#ifndef SIMGRID_VERSION_H +#define SIMGRID_VERSION_H + +#define SIMGRID_GIT_VERSION "@GIT_VERSION@" + +#endif /* SIMGRID_PUBLIC_CONFIG_H */ diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index b351d93a92..abb8f9638a 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -8,6 +8,7 @@ #include "simgrid/s4u/Engine.hpp" #include "simgrid/sg_config.hpp" #include "src/internal_config.h" +#include "src/simgrid/version.h" #include "src/surf/HostImpl.hpp" #include "src/surf/xml/platf.hpp" #include "surf/surf.hpp" diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 502a62f887..e821e20f80 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -786,6 +786,7 @@ set(headers_to_install set(source_of_generated_headers include/simgrid/config.h.in src/internal_config.h.in + src/simgrid/version.h.in include/smpi/mpif.h.in) ### depend of some variables setted upper