diff options
Diffstat (limited to 'src/common/CMakeLists.txt')
| -rw-r--r-- | src/common/CMakeLists.txt | 100 |
1 files changed, 67 insertions, 33 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 845626fc5..43ae8a9e7 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -1,42 +1,70 @@ | |||
| 1 | # Generate cpp with Git revision from template | 1 | # Add a custom command to generate a new shader_cache_version hash when any of the following files change |
| 2 | # Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well | 2 | # NOTE: This is an approximation of what files affect shader generation, its possible something else |
| 3 | set(REPO_NAME "") | 3 | # could affect the result, but much more unlikely than the following files. Keeping a list of files |
| 4 | set(BUILD_VERSION "0") | 4 | # like this allows for much better caching since it doesn't force the user to recompile binary shaders every update |
| 5 | if ($ENV{CI}) | 5 | set(VIDEO_CORE "${CMAKE_SOURCE_DIR}/src/video_core") |
| 6 | if ($ENV{TRAVIS}) | 6 | if (DEFINED ENV{CI}) |
| 7 | if (DEFINED ENV{TRAVIS}) | ||
| 7 | set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) | 8 | set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) |
| 8 | set(BUILD_TAG $ENV{TRAVIS_TAG}) | 9 | set(BUILD_TAG $ENV{TRAVIS_TAG}) |
| 9 | elseif($ENV{APPVEYOR}) | 10 | elseif(DEFINED ENV{APPVEYOR}) |
| 10 | set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) | 11 | set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) |
| 11 | set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) | 12 | set(BUILD_TAG $ENV{APPVEYOR_REPO_TAG_NAME}) |
| 12 | endif() | 13 | endif() |
| 13 | # regex capture the string nightly or canary into CMAKE_MATCH_1 | ||
| 14 | string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) | ||
| 15 | if (${CMAKE_MATCH_COUNT} GREATER 0) | ||
| 16 | # capitalize the first letter of each word in the repo name. | ||
| 17 | string(REPLACE "-" ";" REPO_NAME_LIST ${CMAKE_MATCH_1}) | ||
| 18 | foreach(WORD ${REPO_NAME_LIST}) | ||
| 19 | string(SUBSTRING ${WORD} 0 1 FIRST_LETTER) | ||
| 20 | string(SUBSTRING ${WORD} 1 -1 REMAINDER) | ||
| 21 | string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) | ||
| 22 | set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER}") | ||
| 23 | endforeach() | ||
| 24 | if (BUILD_TAG) | ||
| 25 | string(REGEX MATCH "${CMAKE_MATCH_1}-([0-9]+)" OUTVAR ${BUILD_TAG}) | ||
| 26 | if (${CMAKE_MATCH_COUNT} GREATER 0) | ||
| 27 | set(BUILD_VERSION ${CMAKE_MATCH_1}) | ||
| 28 | endif() | ||
| 29 | if (BUILD_VERSION) | ||
| 30 | # This leaves a trailing space on the last word, but we actually want that | ||
| 31 | # because of how it's styled in the title bar. | ||
| 32 | set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION} ") | ||
| 33 | else() | ||
| 34 | set(BUILD_FULLNAME "") | ||
| 35 | endif() | ||
| 36 | endif() | ||
| 37 | endif() | ||
| 38 | endif() | 14 | endif() |
| 39 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) | 15 | add_custom_command(OUTPUT scm_rev.cpp |
| 16 | COMMAND ${CMAKE_COMMAND} | ||
| 17 | -DSRC_DIR="${CMAKE_SOURCE_DIR}" | ||
| 18 | -DBUILD_REPOSITORY="${BUILD_REPOSITORY}" | ||
| 19 | -DBUILD_TAG="${BUILD_TAG}" | ||
| 20 | -P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" | ||
| 21 | DEPENDS | ||
| 22 | # WARNING! It was too much work to try and make a common location for this list, | ||
| 23 | # so if you need to change it, please update CMakeModules/GenerateSCMRev.cmake as well | ||
| 24 | "${VIDEO_CORE}/renderer_opengl/gl_shader_cache.cpp" | ||
| 25 | "${VIDEO_CORE}/renderer_opengl/gl_shader_cache.h" | ||
| 26 | "${VIDEO_CORE}/renderer_opengl/gl_shader_decompiler.cpp" | ||
| 27 | "${VIDEO_CORE}/renderer_opengl/gl_shader_decompiler.h" | ||
| 28 | "${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.cpp" | ||
| 29 | "${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.h" | ||
| 30 | "${VIDEO_CORE}/renderer_opengl/gl_shader_gen.cpp" | ||
| 31 | "${VIDEO_CORE}/renderer_opengl/gl_shader_gen.h" | ||
| 32 | "${VIDEO_CORE}/shader/decode/arithmetic.cpp" | ||
| 33 | "${VIDEO_CORE}/shader/decode/arithmetic_half.cpp" | ||
| 34 | "${VIDEO_CORE}/shader/decode/arithmetic_half_immediate.cpp" | ||
| 35 | "${VIDEO_CORE}/shader/decode/arithmetic_immediate.cpp" | ||
| 36 | "${VIDEO_CORE}/shader/decode/arithmetic_integer.cpp" | ||
| 37 | "${VIDEO_CORE}/shader/decode/arithmetic_integer_immediate.cpp" | ||
| 38 | "${VIDEO_CORE}/shader/decode/bfe.cpp" | ||
| 39 | "${VIDEO_CORE}/shader/decode/bfi.cpp" | ||
| 40 | "${VIDEO_CORE}/shader/decode/conversion.cpp" | ||
| 41 | "${VIDEO_CORE}/shader/decode/ffma.cpp" | ||
| 42 | "${VIDEO_CORE}/shader/decode/float_set.cpp" | ||
| 43 | "${VIDEO_CORE}/shader/decode/float_set_predicate.cpp" | ||
| 44 | "${VIDEO_CORE}/shader/decode/half_set.cpp" | ||
| 45 | "${VIDEO_CORE}/shader/decode/half_set_predicate.cpp" | ||
| 46 | "${VIDEO_CORE}/shader/decode/hfma2.cpp" | ||
| 47 | "${VIDEO_CORE}/shader/decode/integer_set.cpp" | ||
| 48 | "${VIDEO_CORE}/shader/decode/integer_set_predicate.cpp" | ||
| 49 | "${VIDEO_CORE}/shader/decode/memory.cpp" | ||
| 50 | "${VIDEO_CORE}/shader/decode/texture.cpp" | ||
| 51 | "${VIDEO_CORE}/shader/decode/other.cpp" | ||
| 52 | "${VIDEO_CORE}/shader/decode/predicate_set_predicate.cpp" | ||
| 53 | "${VIDEO_CORE}/shader/decode/predicate_set_register.cpp" | ||
| 54 | "${VIDEO_CORE}/shader/decode/register_set_predicate.cpp" | ||
| 55 | "${VIDEO_CORE}/shader/decode/shift.cpp" | ||
| 56 | "${VIDEO_CORE}/shader/decode/video.cpp" | ||
| 57 | "${VIDEO_CORE}/shader/decode/xmad.cpp" | ||
| 58 | "${VIDEO_CORE}/shader/decode.cpp" | ||
| 59 | "${VIDEO_CORE}/shader/shader_ir.cpp" | ||
| 60 | "${VIDEO_CORE}/shader/shader_ir.h" | ||
| 61 | "${VIDEO_CORE}/shader/track.cpp" | ||
| 62 | # and also check that the scm_rev files haven't changed | ||
| 63 | "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" | ||
| 64 | "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h" | ||
| 65 | # technically we should regenerate if the git version changed, but its not worth the effort imo | ||
| 66 | "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" | ||
| 67 | ) | ||
| 40 | 68 | ||
| 41 | add_library(common STATIC | 69 | add_library(common STATIC |
| 42 | alignment.h | 70 | alignment.h |
| @@ -64,10 +92,14 @@ add_library(common STATIC | |||
| 64 | logging/text_formatter.cpp | 92 | logging/text_formatter.cpp |
| 65 | logging/text_formatter.h | 93 | logging/text_formatter.h |
| 66 | math_util.h | 94 | math_util.h |
| 95 | memory_hook.cpp | ||
| 96 | memory_hook.h | ||
| 67 | microprofile.cpp | 97 | microprofile.cpp |
| 68 | microprofile.h | 98 | microprofile.h |
| 69 | microprofileui.h | 99 | microprofileui.h |
| 70 | misc.cpp | 100 | misc.cpp |
| 101 | page_table.cpp | ||
| 102 | page_table.h | ||
| 71 | param_package.cpp | 103 | param_package.cpp |
| 72 | param_package.h | 104 | param_package.h |
| 73 | quaternion.h | 105 | quaternion.h |
| @@ -86,6 +118,8 @@ add_library(common STATIC | |||
| 86 | threadsafe_queue.h | 118 | threadsafe_queue.h |
| 87 | timer.cpp | 119 | timer.cpp |
| 88 | timer.h | 120 | timer.h |
| 121 | uint128.cpp | ||
| 122 | uint128.h | ||
| 89 | vector_math.h | 123 | vector_math.h |
| 90 | web_result.h | 124 | web_result.h |
| 91 | ) | 125 | ) |