Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ fix skin changes bugs #52

Merged
merged 7 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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