On 11/20/18 4:13 PM, Oleh Kravchenko wrote:
> I don't like idea to cover "cmake && make" with special bash script,
> just to export SOURCE_DATE_EPOCH.

SOURCE_DATE_EPOCH was created for use by packagers where tools
already wrap the build.  By making it an environment variable
packagers could jump through any number of build system layers
with no patching.

Build systems configure compilers with command-line flags, not
environment variables.  If you want to do this from within the
build system then GCC could be taught a new option for that.

You could try hacking it with `CMAKE_<LANG>_COMPILER_LAUNCHER`:

  https://cmake.org/cmake/help/v3.13/variable/CMAKE_LANG_COMPILER_LAUNCHER.html

e.g. -DCMAKE_C_COMPILER_LAUNCHER='env;SOURCE_DATE_EPOCH=1' or

```cmake
set(CMAKE_C_COMPILER_LAUNCHER env SOURCE_DATE_EPOCH=1)
```

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake-developers

Reply via email to