mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-13 23:27:12 +00:00
Merge pull request #517 from Interlisp/improve-cmake-vdate-depends
Improve cmake vdate depends
This commit is contained in:
commit
89b2b4f866
@ -438,9 +438,9 @@ SET(MAIKO_HDRS
|
||||
inc/z2defs.h
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(gen-vdate
|
||||
ADD_CUSTOM_COMMAND(OUTPUT vdate.c
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/mkvdate > vdate.c
|
||||
BYPRODUCTS vdate.c
|
||||
DEPENDS ${MAIKO_SRCS} ${MAIKO_HDRS} ${MAIKO_DISPLAY_X11_SRCS} ${MAIKO_DISPLAY_X11_HDRS} ${MAIKO_DISPLAY_SDL_SRCS} ${MAIKO_DISPLAY_SDL_HDRS}
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(lde src/ldeboot.c src/unixfork.c)
|
||||
|
||||
16
bin/mkvdate
16
bin/mkvdate
@ -1,6 +1,22 @@
|
||||
#!/bin/sh
|
||||
if command -v "git" >/dev/null 2>&1; then
|
||||
MAIKO_REV="$(git status --porcelain)"
|
||||
if [ $? == 0 ]; then
|
||||
if [ ! -z "$(git status --porcelain)" ]; then
|
||||
MAIKO_REV="$(git rev-parse --short HEAD)-dirty"
|
||||
else
|
||||
MAIKO_REV="$(git rev-parse --short HEAD)"
|
||||
fi
|
||||
else
|
||||
MAIKO_REV="none"
|
||||
fi
|
||||
else
|
||||
MAIKO_REV = "none"
|
||||
fi
|
||||
cat <<EOF
|
||||
#include <time.h>
|
||||
extern const time_t MDate;
|
||||
const time_t MDate = $(date +%s);
|
||||
extern const char *MaikoGitVersion;
|
||||
const char *MaikoGitVersion = "maiko git version: $MAIKO_REV";
|
||||
EOF
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user