Merge branch 'develop' of https://git.khaganat.net/khaganat/mmorpg_khanat/khanat-opennel-code into develop
This commit is contained in:
commit
73ea688f68
3 changed files with 230 additions and 88 deletions
|
@ -39,6 +39,7 @@ Linux client build:
|
|||
stage: build
|
||||
except:
|
||||
- ryzomcore
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: debian:jessie
|
||||
|
@ -88,6 +89,8 @@ Linux client build:
|
|||
|
||||
Linux server debian_amd64_strech build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: amd64/debian:9
|
||||
|
@ -169,6 +172,8 @@ Linux server debian_amd64_strech build:
|
|||
|
||||
Linux client debian_amd64_strech build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: amd64/debian:9
|
||||
|
@ -229,6 +234,8 @@ Linux client debian_amd64_strech build:
|
|||
|
||||
Linux client_static debian_amd64_strech build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: amd64/debian:9
|
||||
|
@ -335,6 +342,8 @@ Linux client_static debian_amd64_strech build:
|
|||
# Fedora Client
|
||||
Linux client fedora_amd64_27 build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: amd64/fedora:27
|
||||
|
@ -395,6 +404,8 @@ Linux client fedora_amd64_27 build:
|
|||
# Ubuntu Client
|
||||
Linux client ubuntu_amd64_17_10 build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: amd64/ubuntu:17.10
|
||||
|
@ -450,6 +461,8 @@ Linux client ubuntu_amd64_17_10 build:
|
|||
# Archlinux Client
|
||||
Linux client archlinux build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: base/archlinux
|
||||
|
@ -544,6 +557,8 @@ Linux client archlinux build:
|
|||
|
||||
Windows client build:
|
||||
stage: build
|
||||
except:
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: amd64/debian:9
|
||||
|
@ -585,8 +600,12 @@ OSX client build:
|
|||
stage: build
|
||||
only:
|
||||
- tags
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- OSX
|
||||
variables:
|
||||
# Éviter de cloner tout le dépot à chaque fois, à la place juste récuperer les changements
|
||||
GIT_STRATEGY: fetch
|
||||
script:
|
||||
# Création de l'environnement de compilation
|
||||
- mkdir -p BUILD/x86_64
|
||||
|
@ -607,6 +626,7 @@ Linux client test:
|
|||
stage: test
|
||||
except:
|
||||
- ryzomcore
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- Docker
|
||||
image: ubuntu:14.04
|
||||
|
@ -618,8 +638,9 @@ Linux client test:
|
|||
|
||||
.OSX client test:
|
||||
stage: test
|
||||
except:
|
||||
- ryzomcore
|
||||
only:
|
||||
- tags
|
||||
- mac-ci-build
|
||||
tags:
|
||||
- OSX
|
||||
script:
|
||||
|
|
106
code/CMakeModules/FindGit.cmake
Normal file
106
code/CMakeModules/FindGit.cmake
Normal file
|
@ -0,0 +1,106 @@
|
|||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# FindGit
|
||||
# -------
|
||||
#
|
||||
# The module defines the following variables:
|
||||
#
|
||||
# ``GIT_EXECUTABLE``
|
||||
# Path to Git command-line client.
|
||||
# ``Git_FOUND``, ``GIT_FOUND``
|
||||
# True if the Git command-line client was found.
|
||||
# ``GIT_VERSION_STRING``
|
||||
# The version of Git found.
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# .. code-block:: cmake
|
||||
#
|
||||
# find_package(Git)
|
||||
# if(Git_FOUND)
|
||||
# message("Git found: ${GIT_EXECUTABLE}")
|
||||
# endif()
|
||||
|
||||
# Look for 'git' or 'eg' (easy git)
|
||||
#
|
||||
set(git_names git eg)
|
||||
|
||||
# Prefer .cmd variants on Windows unless running in a Makefile
|
||||
# in the MSYS shell.
|
||||
#
|
||||
if(CMAKE_HOST_WIN32)
|
||||
if(NOT CMAKE_GENERATOR MATCHES "MSYS")
|
||||
set(git_names git.cmd git eg.cmd eg)
|
||||
# GitHub search path for Windows
|
||||
file(GLOB github_path
|
||||
"$ENV{LOCALAPPDATA}/Github/PortableGit*/cmd"
|
||||
"$ENV{LOCALAPPDATA}/Github/PortableGit*/bin"
|
||||
)
|
||||
# SourceTree search path for Windows
|
||||
set(_git_sourcetree_path "$ENV{LOCALAPPDATA}/Atlassian/SourceTree/git_local/bin")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# First search the PATH and specific locations.
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES ${git_names}
|
||||
PATHS ${github_path} ${_git_sourcetree_path}
|
||||
DOC "Git command line client"
|
||||
)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
# Now look for installations in Git/ directories under typical installation
|
||||
# prefixes on Windows. Exclude PATH from this search because VS 2017's
|
||||
# command prompt happens to have a PATH entry with a Git/ subdirectory
|
||||
# containing a minimal git not meant for general use.
|
||||
find_program(GIT_EXECUTABLE
|
||||
NAMES ${git_names}
|
||||
PATH_SUFFIXES Git/cmd Git/bin
|
||||
NO_SYSTEM_ENVIRONMENT_PATH
|
||||
DOC "Git command line client"
|
||||
)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(GIT_EXECUTABLE)
|
||||
|
||||
MACRO(Git_WC_INFO dir prefix)
|
||||
EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} log -r --pretty=format:"%d;%H;%an" .
|
||||
WORKING_DIRECTORY ${dir}
|
||||
OUTPUT_VARIABLE ${prefix}_WC_INFO
|
||||
ERROR_VARIABLE Git_info_error
|
||||
RESULT_VARIABLE Git_info_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
IF(NOT ${Git_info_result} EQUAL 0)
|
||||
MESSAGE(SEND_ERROR "Command \"${GIT_EXECUTABLE} log\" failed with output:\n${Git_info_error}")
|
||||
ELSE()
|
||||
LIST(LENGTH ${prefix}_WC_INFO _COUNT)
|
||||
IF(_COUNT EQUAL 4)
|
||||
LIST(GET ${prefix}_WC_INFO 0 ${prefix}_WC_REVISION)
|
||||
LIST(GET ${prefix}_WC_INFO 1 ${prefix}_WC_CHANGESET)
|
||||
LIST(GET ${prefix}_WC_INFO 3 ${prefix}_WC_LAST_CHANGED_AUTHOR)
|
||||
ELSE()
|
||||
MESSAGE(STATUS "Bad output from HG")
|
||||
SET(${prefix}_WC_REVISION "unknown")
|
||||
SET(${prefix}_WC_CHANGESET "unknown")
|
||||
SET(${prefix}_WC_BRANCH "unknown")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDMACRO()
|
||||
|
||||
unset(git_names)
|
||||
unset(_git_sourcetree_path)
|
||||
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE git_version
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if (git_version MATCHES "^git version [0-9]")
|
||||
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
|
||||
endif()
|
||||
unset(git_version)
|
||||
endif()
|
|
@ -72,6 +72,16 @@ IF(EXISTS "${ROOT_DIR}/.hg/")
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(EXISTS "${ROOT_DIR}/.git/")
|
||||
FIND_PACKAGE(Git)
|
||||
|
||||
IF(GIT_FOUND)
|
||||
Git_WC_INFO(${ROOT_DIR} ER)
|
||||
SET(REVISION ${ER_WC_REVISION})
|
||||
SET(CHANGESET ${ER_WC_CHANGESET})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# if processing exported sources, use "revision" file if exists
|
||||
IF(SOURCE_DIR AND NOT DEFINED REVISION)
|
||||
SET(REVISION_FILE ${SOURCE_DIR}/revision)
|
||||
|
@ -81,6 +91,11 @@ IF(SOURCE_DIR AND NOT DEFINED REVISION)
|
|||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# Prevent crash if no revision from git or mercurial found
|
||||
IF(NOT DEFINED REVISION)
|
||||
SET(REVISION 0)
|
||||
ENDIF()
|
||||
|
||||
IF(DEFINED REVISION)
|
||||
MESSAGE(STATUS "Found revision ${REVISION}")
|
||||
ENDIF()
|
||||
|
|
Loading…
Reference in a new issue