File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ project(Emu68 VERSION 0.9.20)
4
4
include (cmake/verstring.cmake)
5
5
include (cmake/firmware_download.cmake)
6
6
get_verstring(VERSTRING)
7
+ get_git_sha(GIT_SHA)
7
8
8
9
set (CMAKE_C_EXTENSIONS ON )
9
10
set (CMAKE_CXX_STANDARD 11)
@@ -188,4 +189,4 @@ add_subdirectory(external)
188
189
189
190
target_link_libraries (Emu68.elf tinystl capstone-static )
190
191
target_include_directories (Emu68.elf PRIVATE ${CMAKE_SOURCE_DIR} /include ${CMAKE_SOURCE_DIR} /external/capstone/include )
191
- target_compile_definitions (Emu68.elf PRIVATE VERSION_STRING="${VERSTRING} " )
192
+ target_compile_definitions (Emu68.elf PRIVATE VERSION_STRING="${VERSTRING} " GIT_SHA= " ${GIT_SHA} " )
Original file line number Diff line number Diff line change @@ -9,3 +9,9 @@ function(get_verstring OUTPUT)
9
9
endif ()
10
10
set (${OUTPUT} "$VER: ${PROJECT_NAME} ${PROJECT_VERSION} ${PROJECT_DATE} git:${GIT_HASH}${GIT_PORCELAIN} " PARENT_SCOPE)
11
11
endfunction (get_verstring)
12
+
13
+ function (get_git_sha OUTPUT )
14
+ find_package (Git)
15
+ execute_process (COMMAND ${GIT_EXECUTABLE} rev-parse HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
16
+ set (${OUTPUT} "${GIT_HASH} " PARENT_SCOPE)
17
+ endfunction (get_git_sha)
You can’t perform that action at this time.
0 commit comments