Added a windows batch file version of the gitGenHdr script.
This commit is contained in:
parent
24863422ff
commit
70919c9458
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
set OUTPUT_DIR=%1
|
||||||
|
|
||||||
|
set OUTPUT_FILE=%OUTPUT_DIR%/fceux_git_info.cpp
|
||||||
|
|
||||||
|
git config --get remote.origin.url > git_url.txt
|
||||||
|
git rev-parse HEAD > git_rev.txt
|
||||||
|
|
||||||
|
set /P GIT_URL=<git_url.txt
|
||||||
|
set /P GIT_REV=<git_rev.txt
|
||||||
|
|
||||||
|
echo %GIT_URL%
|
||||||
|
echo %GIT_REV%
|
||||||
|
|
||||||
|
echo // fceux git_info.cpp -- DO NOT EDIT: This file is auto-generated at build > %OUTPUT_FILE%
|
||||||
|
echo #include "Qt/fceux_git_info.h" >> %OUTPUT_FILE%
|
||||||
|
echo #define FCEUX_GIT_URL "%GIT_URL%" >> %OUTPUT_FILE%
|
||||||
|
echo #define FCEUX_GIT_REV "%GIT_REV%" >> %OUTPUT_FILE%
|
||||||
|
echo const char *fceu_get_git_url(void){ return FCEUX_GIT_URL; } >> %OUTPUT_FILE%
|
||||||
|
echo const char *fceu_get_git_rev(void){ return FCEUX_GIT_REV; } >> %OUTPUT_FILE%
|
|
@ -10,7 +10,7 @@ echo "Output File: $OUTPUT_DIR/$FILE";
|
||||||
GIT_URL=`git config --get remote.origin.url`;
|
GIT_URL=`git config --get remote.origin.url`;
|
||||||
GIT_REV=`git rev-parse HEAD`;
|
GIT_REV=`git rev-parse HEAD`;
|
||||||
|
|
||||||
echo "// fceux_gitrev.cpp -- DO NOT EDIT: This file is auto-generated at build" >| $TMP_FILE;
|
echo "// fceux_git_info.cpp -- DO NOT EDIT: This file is auto-generated at build" >| $TMP_FILE;
|
||||||
echo "#include \"Qt/fceux_git_info.h\" " >> $TMP_FILE;
|
echo "#include \"Qt/fceux_git_info.h\" " >> $TMP_FILE;
|
||||||
echo "#define FCEUX_GIT_URL \"$GIT_URL\" " >> $TMP_FILE;
|
echo "#define FCEUX_GIT_URL \"$GIT_URL\" " >> $TMP_FILE;
|
||||||
echo "#define FCEUX_GIT_REV \"$GIT_REV\" " >> $TMP_FILE;
|
echo "#define FCEUX_GIT_REV \"$GIT_REV\" " >> $TMP_FILE;
|
||||||
|
|
|
@ -15,7 +15,7 @@ if(WIN32)
|
||||||
find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
find_package(Qt5 COMPONENTS Widgets OpenGL REQUIRED)
|
||||||
add_definitions( ${Qt5Widgets_DEFINITIONS} )
|
add_definitions( ${Qt5Widgets_DEFINITIONS} )
|
||||||
include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
|
include_directories( ${Qt5Widgets_INCLUDE_DIRS} )
|
||||||
add_definitions( -DMSVC )
|
add_definitions( -DMSVC -D_CRT_SECURE_NO_WARNINGS )
|
||||||
add_definitions( -D__SDL__ -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
|
add_definitions( -D__SDL__ -D__QT_DRIVER__ -DQT_DEPRECATED_WARNINGS )
|
||||||
add_definitions( -DFCEUDEF_DEBUGGER )
|
add_definitions( -DFCEUDEF_DEBUGGER )
|
||||||
include_directories( C:/SDL2/include )
|
include_directories( C:/SDL2/include )
|
||||||
|
@ -496,10 +496,17 @@ endif()
|
||||||
|
|
||||||
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
|
set(SOURCES ${SRC_CORE} ${SRC_DRIVERS_COMMON} ${SRC_DRIVERS_SDL})
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR}/scripts/genGitHdr.bat ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
VERBATIM )
|
||||||
|
else()
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/scripts/genGitHdr.sh ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_SOURCE_DIR}/scripts/genGitHdr.sh ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
VERBATIM )
|
VERBATIM )
|
||||||
|
endif()
|
||||||
|
|
||||||
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp PROPERTY SKIP_AUTOGEN ON)
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/fceux_git_info.cpp PROPERTY SKIP_AUTOGEN ON)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue