Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 874de694 authored by gsell's avatar gsell
Browse files

create 'OPALrevision.h' during make

parent 49516309
No related branches found
No related tags found
No related merge requests found
......@@ -222,19 +222,18 @@ endif ()
option (ENABLE_DOXYDOC "compile Doxygen documentation" OFF)
include (FindGit)
if (GIT_FOUND)
set (OPAL_WC_REVISION 0)
execute_PROCESS(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND git rev-parse HEAD
OUTPUT_VARIABLE GIT_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
)
set (OPAL_WC_REVISION \"${GIT_OUT}\")
else ()
message (STATUS "could not find git")
set (OPAL_WC_REVISION \"\")
endif ()
add_custom_target(always_rebuild ALL
DEPENDS
src/OPALrevision.h
)
add_custom_command(
OUTPUT src/OPALrevision.h
COMMAND ./gen_OPALrevision
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS
always_rebuild
)
add_subdirectory (ippl)
add_subdirectory (optimizer)
......
#!/bin/bash
#
# rewritting 'src/OPALrevision.h'
# if a git binary is in $PATH and we are in a Git work tree; then
# write the Git revision
# if
# (a git binary does not exist in $PATH or we are in a Git work tree)
# and the file does not exist; then write "unknown"
#
function print {
echo '#define GIT_VERSION '\"$1\" > src/OPALrevision.h
exit $?
}
which -a git &> /dev/null || print unknown
if git rev-parse --is-inside-work-tree &> /dev/null; then
revision=$(git rev-parse HEAD)
print ${revision}
elif [[ ! -e src/OPALrevision.h ]]; then
print unknown
fi
......@@ -30,7 +30,6 @@ else ()
endif ()
configure_file(config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALconfig.h)
configure_file(revision.h.in ${CMAKE_CURRENT_SOURCE_DIR}/OPALrevision.h)
set (OPAL_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set (OPAL_SRCS )
......
#define GIT_VERSION ${OPAL_WC_REVISION}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment