[cmake-developers] ENV{SOURCE_DATE_EPOCH}

Oleh Kravchenko oleg at kaa.org.ua
Tue Nov 20 16:40:24 EST 2018


20.11.18 23:29, Brad King wrote:
> 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.

That's makes me confused, because CMake has CPack.
And with CPack process looks like:
- `cmake && make package`
So there are no any packagers tools, all work done with CMake.

> 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)
> ```

Thank you, I will try that.

-- 
Best regards,
Oleh Kravchenko



More information about the cmake-developers mailing list