diff options
| -rw-r--r-- | CMakeModules/GenerateSCMRev.cmake | 10 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 29 |
2 files changed, 4 insertions, 35 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake index 0e4bd121c..2cdb9189a 100644 --- a/CMakeModules/GenerateSCMRev.cmake +++ b/CMakeModules/GenerateSCMRev.cmake | |||
| @@ -7,11 +7,6 @@ function(get_timestamp _var) | |||
| 7 | set(${_var} "${timestamp}" PARENT_SCOPE) | 7 | set(${_var} "${timestamp}" PARENT_SCOPE) |
| 8 | endfunction() | 8 | endfunction() |
| 9 | 9 | ||
| 10 | list(APPEND CMAKE_MODULE_PATH "${SRC_DIR}/externals/cmake-modules") | ||
| 11 | |||
| 12 | # Find the package here with the known path so that the GetGit commands can find it as well | ||
| 13 | find_package(Git QUIET PATHS "${GIT_EXECUTABLE}") | ||
| 14 | |||
| 15 | # generate git/build information | 10 | # generate git/build information |
| 16 | include(GetGitRevisionDescription) | 11 | include(GetGitRevisionDescription) |
| 17 | if(NOT GIT_REF_SPEC) | 12 | if(NOT GIT_REF_SPEC) |
| @@ -29,6 +24,7 @@ get_timestamp(BUILD_DATE) | |||
| 29 | # Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well | 24 | # Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well |
| 30 | set(REPO_NAME "") | 25 | set(REPO_NAME "") |
| 31 | set(BUILD_VERSION "0") | 26 | set(BUILD_VERSION "0") |
| 27 | set(BUILD_ID ${DISPLAY_VERSION}) | ||
| 32 | if (BUILD_REPOSITORY) | 28 | if (BUILD_REPOSITORY) |
| 33 | # regex capture the string nightly or canary into CMAKE_MATCH_1 | 29 | # regex capture the string nightly or canary into CMAKE_MATCH_1 |
| 34 | string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) | 30 | string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) |
| @@ -57,6 +53,4 @@ if (BUILD_REPOSITORY) | |||
| 57 | endif() | 53 | endif() |
| 58 | endif() | 54 | endif() |
| 59 | 55 | ||
| 60 | # The variable SRC_DIR must be passed into the script | 56 | configure_file(scm_rev.cpp.in scm_rev.cpp @ONLY) |
| 61 | # (since it uses the current build directory for all values of CMAKE_*_DIR) | ||
| 62 | configure_file("${SRC_DIR}/src/common/scm_rev.cpp.in" "scm_rev.cpp" @ONLY) | ||
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 68436a4bc..3447fabd8 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -14,32 +14,7 @@ if (DEFINED ENV{DISPLAYVERSION}) | |||
| 14 | set(DISPLAY_VERSION $ENV{DISPLAYVERSION}) | 14 | set(DISPLAY_VERSION $ENV{DISPLAYVERSION}) |
| 15 | endif () | 15 | endif () |
| 16 | 16 | ||
| 17 | # Pass the path to git to the GenerateSCMRev.cmake as well | 17 | include(GenerateSCMRev) |
| 18 | find_package(Git QUIET) | ||
| 19 | |||
| 20 | add_custom_command(OUTPUT scm_rev.cpp | ||
| 21 | COMMAND ${CMAKE_COMMAND} | ||
| 22 | -DSRC_DIR=${PROJECT_SOURCE_DIR} | ||
| 23 | -DBUILD_REPOSITORY=${BUILD_REPOSITORY} | ||
| 24 | -DTITLE_BAR_FORMAT_IDLE=${TITLE_BAR_FORMAT_IDLE} | ||
| 25 | -DTITLE_BAR_FORMAT_RUNNING=${TITLE_BAR_FORMAT_RUNNING} | ||
| 26 | -DBUILD_TAG=${BUILD_TAG} | ||
| 27 | -DBUILD_ID=${DISPLAY_VERSION} | ||
| 28 | -DGIT_REF_SPEC=${GIT_REF_SPEC} | ||
| 29 | -DGIT_REV=${GIT_REV} | ||
| 30 | -DGIT_DESC=${GIT_DESC} | ||
| 31 | -DGIT_BRANCH=${GIT_BRANCH} | ||
| 32 | -DBUILD_FULLNAME=${BUILD_FULLNAME} | ||
| 33 | -DGIT_EXECUTABLE=${GIT_EXECUTABLE} | ||
| 34 | -P ${PROJECT_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake | ||
| 35 | DEPENDS | ||
| 36 | # Check that the scm_rev files haven't changed | ||
| 37 | "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" | ||
| 38 | "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h" | ||
| 39 | # technically we should regenerate if the git version changed, but its not worth the effort imo | ||
| 40 | "${PROJECT_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" | ||
| 41 | VERBATIM | ||
| 42 | ) | ||
| 43 | 18 | ||
| 44 | add_library(common STATIC | 19 | add_library(common STATIC |
| 45 | algorithm.h | 20 | algorithm.h |
| @@ -117,7 +92,7 @@ add_library(common STATIC | |||
| 117 | quaternion.h | 92 | quaternion.h |
| 118 | reader_writer_queue.h | 93 | reader_writer_queue.h |
| 119 | ring_buffer.h | 94 | ring_buffer.h |
| 120 | scm_rev.cpp | 95 | ${CMAKE_CURRENT_BINARY_DIR}/scm_rev.cpp |
| 121 | scm_rev.h | 96 | scm_rev.h |
| 122 | scope_exit.h | 97 | scope_exit.h |
| 123 | settings.cpp | 98 | settings.cpp |