Skip to content

Commit

Permalink
Merge pull request #715 from rabarar/master
Browse files Browse the repository at this point in the history
modified version switch to build without .git repo directory and adde…
  • Loading branch information
robotastic authored Aug 27, 2022
2 parents 180284b + 494d078 commit 8223edc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ cmake_minimum_required(VERSION 3.2)
project(Trunk-Recorder LANGUAGES CXX C VERSION "4.3.2")

configure_file(cmake.h.in "${PROJECT_SOURCE_DIR}/cmake.h" @ONLY)
ADD_COMPILE_DEFINITIONS(MANUAL_GITINFO="${MANUAL_GITINFO}")


# Define the two required variables before including
# the source code for watching a git repository.
Expand Down
6 changes: 5 additions & 1 deletion git.cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ __attribute__ ((visibility ("default"))) void GitMetadata::VersionInfo() {
<< "\t" << GitMetadata::CommitSubject() << "\n" << GitMetadata::CommitBody() << std::endl;
}
else {
std::cerr << "WARN: failed to get the current git state. Is this a git repo?" << std::endl;
#ifdef MANUAL_GITINFO
std::cerr << "INFO: manual git info: " << MANUAL_GITINFO << std::endl;
#else
std::cerr << "WARN: no manual git info defined " << std::endl;
#endif
}
}

2 changes: 1 addition & 1 deletion git_watcher.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ macro(RunGitCommand)
# those default values.
if(GIT_FAIL_IF_NONZERO_EXIT )
string(REPLACE ";" " " args_with_spaces "${ARGV}")
message(FATAL_ERROR "${stderr} (${GIT_EXECUTABLE} ${args_with_spaces})")
message("${stderr} (${GIT_EXECUTABLE} ${args_with_spaces})")
endif()
endif()
endmacro()
Expand Down

0 comments on commit 8223edc

Please sign in to comment.