Add git_version.h generation to CMake
This commit is contained in:
parent
b6b21930fa
commit
64d0f86d8d
2 changed files with 17 additions and 1 deletions
|
@ -86,7 +86,6 @@ script:
|
||||||
make test || travis_terminate 1;
|
make test || travis_terminate 1;
|
||||||
coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null;
|
coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null;
|
||||||
else
|
else
|
||||||
./build/version.sh .;
|
|
||||||
mkdir build-dir;
|
mkdir build-dir;
|
||||||
cd build-dir;
|
cd build-dir;
|
||||||
cmake -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wno-unused-parameter -pedantic' -DCMAKE_C_FLAGS='-Wall' -DWITH_STARTUPLOG=ON -DWITH_TEST=ON ..;
|
cmake -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wno-unused-parameter -pedantic' -DCMAKE_C_FLAGS='-Wall' -DWITH_STARTUPLOG=ON -DWITH_TEST=ON ..;
|
||||||
|
|
|
@ -470,6 +470,23 @@ add_executable(Aegisub WIN32
|
||||||
target_link_libraries(Aegisub ${CMAKE_DL_LIBS} libaegisub luabins luajit resrc csri)
|
target_link_libraries(Aegisub ${CMAKE_DL_LIBS} libaegisub luabins luajit resrc csri)
|
||||||
target_compile_definitions(Aegisub PRIVATE CMAKE_BUILD)
|
target_compile_definitions(Aegisub PRIVATE CMAKE_BUILD)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/build/git_version.h")
|
||||||
|
message(SEND_ERROR
|
||||||
|
"build/git_version.h not found.\n"
|
||||||
|
"Automatic generation of build/git_version.h is not supported on Windows. Please run\n"
|
||||||
|
" build/version.sh .\n"
|
||||||
|
"at the source directory from an environment with bash and git. You may use WSL, msys (git bash), or Cygwin."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_custom_target(git_version build/version.sh .
|
||||||
|
BYPRODUCTS "${PROJECT_SOURCE_DIR}/build/git_version.h" "${PROJECT_SOURCE_DIR}/build/git_version.xml"
|
||||||
|
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||||
|
)
|
||||||
|
add_dependencies(Aegisub git_version)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(WITH_BUILD_CREDIT OFF CACHE BOOL "Whether show build credit in about dialog")
|
set(WITH_BUILD_CREDIT OFF CACHE BOOL "Whether show build credit in about dialog")
|
||||||
if(WITH_BUILD_CREDIT)
|
if(WITH_BUILD_CREDIT)
|
||||||
set(BUILD_CREDIT "" CACHE STRING "Build credit shown in about dialog")
|
set(BUILD_CREDIT "" CACHE STRING "Build credit shown in about dialog")
|
||||||
|
|
Loading…
Reference in a new issue