diff options
| author | manuel <manuel@mausz.at> | 2016-12-14 02:24:46 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2016-12-14 02:24:46 +0100 |
| commit | a662ba767a6444b76b0394eb60380eee3e839db7 (patch) | |
| tree | a13d904b75e8d899e2b11df3db5bd2a8a47b0acb /project/cmake/scripts/common/HandleDepends.cmake | |
| parent | 2818eb9609d118212211cd657134974f10428b31 (diff) | |
| download | kodi-pvr-build-a662ba767a6444b76b0394eb60380eee3e839db7.tar.gz kodi-pvr-build-a662ba767a6444b76b0394eb60380eee3e839db7.tar.bz2 kodi-pvr-build-a662ba767a6444b76b0394eb60380eee3e839db7.zip | |
Sync with Krypton branch
Diffstat (limited to 'project/cmake/scripts/common/HandleDepends.cmake')
| -rw-r--r-- | project/cmake/scripts/common/HandleDepends.cmake | 43 |
1 files changed, 5 insertions, 38 deletions
diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake index adc105b..880ccdf 100644 --- a/project/cmake/scripts/common/HandleDepends.cmake +++ b/project/cmake/scripts/common/HandleDepends.cmake | |||
| @@ -17,7 +17,6 @@ function(add_addon_depends addon searchpath) | |||
| 17 | file MATCHES noinstall.txt OR | 17 | file MATCHES noinstall.txt OR |
| 18 | file MATCHES flags.txt OR | 18 | file MATCHES flags.txt OR |
| 19 | file MATCHES deps.txt OR | 19 | file MATCHES deps.txt OR |
| 20 | file MATCHES "[a-z]+-deps[.]txt" OR | ||
| 21 | file MATCHES platforms.txt)) | 20 | file MATCHES platforms.txt)) |
| 22 | message(STATUS "Processing ${file}") | 21 | message(STATUS "Processing ${file}") |
| 23 | file(STRINGS ${file} def) | 22 | file(STRINGS ${file} def) |
| @@ -50,11 +49,7 @@ function(add_addon_depends addon searchpath) | |||
| 50 | if(EXISTS ${dir}/flags.txt) | 49 | if(EXISTS ${dir}/flags.txt) |
| 51 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) | 50 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) |
| 52 | file(STRINGS ${dir}/flags.txt extraflags) | 51 | file(STRINGS ${dir}/flags.txt extraflags) |
| 53 | |||
| 54 | # replace some custom placeholders | ||
| 55 | string(REPLACE "@MINGW_TOOLCHAIN_FILE@" "${OUTPUT_DIR}/Toolchain_mingw32.cmake" extraflags "${extraflags}") | ||
| 56 | string(REPLACE " " ";" extraflags ${extraflags}) | 52 | string(REPLACE " " ";" extraflags ${extraflags}) |
| 57 | |||
| 58 | message(STATUS "${id} extraflags: ${extraflags}") | 53 | message(STATUS "${id} extraflags: ${extraflags}") |
| 59 | endif() | 54 | endif() |
| 60 | 55 | ||
| @@ -108,18 +103,11 @@ function(add_addon_depends addon searchpath) | |||
| 108 | endif() | 103 | endif() |
| 109 | endif() | 104 | endif() |
| 110 | 105 | ||
| 106 | # on windows "patch.exe" can only handle CR-LF line-endings so we | ||
| 107 | # need to force it to also handle LF-only line endings | ||
| 111 | set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) | 108 | set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) |
| 112 | |||
| 113 | # On Windows "patch.exe" can only handle CR-LF line-endings. | ||
| 114 | # Our patches have LF-only line endings - except when they | ||
| 115 | # have been checked out as part of a dependency hosted on Git | ||
| 116 | # and core.autocrlf=true. | ||
| 117 | if(WIN32) | 109 | if(WIN32) |
| 118 | file(READ ${patch} patch_content_hex HEX) | 110 | set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") |
| 119 | # Force handle LF-only line endings | ||
| 120 | if(NOT patch_content_hex MATCHES "0d0a") | ||
| 121 | set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") | ||
| 122 | endif() | ||
| 123 | endif() | 111 | endif() |
| 124 | endif() | 112 | endif() |
| 125 | 113 | ||
| @@ -143,11 +131,8 @@ function(add_addon_depends addon searchpath) | |||
| 143 | set(INSTALL_COMMAND INSTALL_COMMAND "") | 131 | set(INSTALL_COMMAND INSTALL_COMMAND "") |
| 144 | endif() | 132 | endif() |
| 145 | 133 | ||
| 146 | # check if there's a platform-specific or generic deps.txt containing dependencies on other libraries | 134 | # check if there's a deps.txt containing dependencies on other libraries |
| 147 | if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt) | 135 | if(EXISTS ${dir}/deps.txt) |
| 148 | file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps) | ||
| 149 | message(STATUS "${id} depends: ${deps}") | ||
| 150 | elseif(EXISTS ${dir}/deps.txt) | ||
| 151 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) | 136 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) |
| 152 | file(STRINGS ${dir}/deps.txt deps) | 137 | file(STRINGS ${dir}/deps.txt deps) |
| 153 | message(STATUS "${id} depends: ${deps}") | 138 | message(STATUS "${id} depends: ${deps}") |
| @@ -176,10 +161,6 @@ function(add_addon_depends addon searchpath) | |||
| 176 | PATCH_COMMAND ${PATCH_COMMAND} | 161 | PATCH_COMMAND ${PATCH_COMMAND} |
| 177 | "${INSTALL_COMMAND}") | 162 | "${INSTALL_COMMAND}") |
| 178 | 163 | ||
| 179 | if(CMAKE_VERSION VERSION_GREATER 3.5.9) | ||
| 180 | list(APPEND EXTERNALPROJECT_SETUP GIT_SHALLOW 1) | ||
| 181 | endif() | ||
| 182 | |||
| 183 | # if there's an url defined we need to pass that to externalproject_add() | 164 | # if there's an url defined we need to pass that to externalproject_add() |
| 184 | if(DEFINED url AND NOT "${url}" STREQUAL "") | 165 | if(DEFINED url AND NOT "${url}" STREQUAL "") |
| 185 | # check if there's a third parameter in the file | 166 | # check if there's a third parameter in the file |
| @@ -191,20 +172,6 @@ function(add_addon_depends addon searchpath) | |||
| 191 | GIT_REPOSITORY ${url} | 172 | GIT_REPOSITORY ${url} |
| 192 | GIT_TAG ${revision} | 173 | GIT_TAG ${revision} |
| 193 | "${EXTERNALPROJECT_SETUP}") | 174 | "${EXTERNALPROJECT_SETUP}") |
| 194 | |||
| 195 | # For patchfiles to work, disable (users globally set) autocrlf=true | ||
| 196 | if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER 3.7) | ||
| 197 | message(AUTHOR_WARNING "Make use of GIT_CONFIG") | ||
| 198 | endif() | ||
| 199 | if(WIN32 AND patches) | ||
| 200 | externalproject_add_step(${id} gitconfig | ||
| 201 | COMMAND git config core.autocrlf false | ||
| 202 | COMMAND git rm -rf --cached . | ||
| 203 | COMMAND git reset --hard HEAD | ||
| 204 | COMMENT "Performing gitconfig step: Disabling autocrlf to enable patching for '${id}'" | ||
| 205 | DEPENDERS patch | ||
| 206 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 207 | endif() | ||
| 208 | else() | 175 | else() |
| 209 | set(CONFIGURE_COMMAND "") | 176 | set(CONFIGURE_COMMAND "") |
| 210 | if(NOT WIN32) | 177 | if(NOT WIN32) |
