Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified version switch to build without .git repo directory and adde… #715

Merged
merged 1 commit into from
Aug 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ 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