Skip to content

Commit

Permalink
Merge pull request #52 from AssassinTee/bugfix/skin_changes
Browse files Browse the repository at this point in the history
✨ fix skin changes bugs
  • Loading branch information
AssassinTee authored Apr 30, 2021
2 parents 1c34281 + 7a92d71 commit 6e130f6
Show file tree
Hide file tree
Showing 5 changed files with 664 additions and 842 deletions.
39 changes: 16 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 2.8.12...3.19.1)
if(CMAKE_VERSION VERSION_LESS 3.12)
cmake_policy(VERSION ${CMAKE_VERSION})
endif()

file(STRINGS src/game/version.h VERSION_LINE
LIMIT_COUNT 1
Expand All @@ -17,35 +20,16 @@ else()
message(FATAL_ERROR "Couldn't parse version from src/game/version.h")
endif()

if(POLICY CMP0017)
cmake_policy(SET CMP0017 NEW)
endif()

if(POLICY CMP0072)
cmake_policy(SET CMP0072 OLD)
endif()

if(POLICY CMP0091)
cmake_policy(SET CMP0091 NEW)
endif()

if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif()

if(POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
project(teeworlds VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
else()
project(teeworlds)
# Extra support for CMake pre-3.0
if(NOT POLICY CMP0048)
set(PROJECT_VERSION_MAJOR ${VERSION_MAJOR})
set(PROJECT_VERSION_MINOR ${VERSION_MINOR})
set(PROJECT_VERSION_PATCH ${VERSION_PATCH})
set(PROJECT_VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
endif()

project(teeworlds VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
set (CMAKE_CXX_STANDARD 11)

set(ORIGINAL_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
set(ORIGINAL_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
set(ORIGINAL_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
Expand Down Expand Up @@ -447,6 +431,15 @@ if(NOT(GTEST_FOUND) AND DOWNLOAD_GTEST)
message(WARNING "Build step for googletest failed: ${result}")
set(DOWNLOAD_GTEST OFF)
else()
file(GLOB_RECURSE DDNET_GTEST_CMAKELISTS ${CMAKE_BINARY_DIR}/googletest-src/CMakeLists.txt)
foreach(file ${DDNET_GTEST_CMAKELISTS})
file(READ ${file} CONTENTS)
string(REPLACE "cmake_minimum_required(VERSION 2.6.4)" "cmake_minimum_required(VERSION 2.8.12...3.19.1)" CONTENTS "${CONTENTS}")
string(REPLACE "cmake_minimum_required(VERSION 2.6.4)" "cmake_minimum_required(VERSION 2.8.12...3.19.1)" CONTENTS "${CONTENTS}")
string(REPLACE "cmake_minimum_required(VERSION 2.8.8)" "cmake_minimum_required(VERSION 2.8.12...3.19.1)" CONTENTS "${CONTENTS}")
file(WRITE ${file} "${CONTENTS}")
endforeach()

# Prevent overriding the parent project's compiler/linker settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

Expand Down
2 changes: 1 addition & 1 deletion cmake/Download_GTest_CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 2.8.12...3.19.1)

project(googletest-download NONE)

Expand Down
2 changes: 1 addition & 1 deletion src/base/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -2023,7 +2023,7 @@ void str_append(char *dst, const char *src, int dst_size)

void str_copy(char *dst, const char *src, int dst_size)
{
strncpy(dst, src, dst_size);
strncpy(dst, src, dst_size-1);
dst[dst_size-1] = 0; /* assure null termination */
}

Expand Down
Loading

0 comments on commit 6e130f6

Please sign in to comment.