Merge pull request #154 from Wargus/tim/vs2015
Compile with VS 2015 with updated dependencies
This commit is contained in:
commit
62d1dc4df5
8 changed files with 47 additions and 28 deletions
|
@ -629,6 +629,11 @@ if(LINUX)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32 AND MSVC AND NOT CMAKE_PREFIX_PATH)
|
||||
# use a default
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies)
|
||||
endif()
|
||||
|
||||
# Find all libraries
|
||||
|
||||
option(ENABLE_STATIC "Compile Stratagus as static executable" OFF)
|
||||
|
@ -757,7 +762,10 @@ if(WITH_FLUIDSYNTH AND FLUIDSYNTH_FOUND)
|
|||
add_definitions(-DUSE_FLUIDSYNTH ${FLUIDSYNTH_DEFINITIONS})
|
||||
include_directories(${FLUIDSYNTH_INCLUDE_DIR})
|
||||
set(stratagus_LIBS ${stratagus_LIBS} ${FLUIDSYNTH_LIBRARY})
|
||||
set(MAKENSIS_FLAGS ${MAKENSIS_FLAGS} -DFLUID)
|
||||
find_file(FLUIDSYNTH_DLL libfluidsynth.dll HINTS ${CMAKE_PREFIX_PATH}/bin)
|
||||
find_file(GLIB_DLL libglib-2.0-0.dll HINTS ${CMAKE_PREFIX_PATH} PATH_SUFFIXES bin lib)
|
||||
find_file(GTHREAD_DLL libgthread-2.0-0.dll HINTS ${CMAKE_PREFIX_PATH} PATH_SUFFIXES bin lib)
|
||||
set(MAKENSIS_FLAGS ${MAKENSIS_FLAGS} -DFLUID -DFLUIDDLL=libfluidsynth.dll -DGTHREADDLL=libglib-2.0-0.dll -DGLIBDLL=libgthread-2.0-0.dll)
|
||||
endif()
|
||||
|
||||
if(WITH_MIKMOD AND MIKMOD_FOUND)
|
||||
|
@ -830,7 +838,7 @@ if(WIN32)
|
|||
endif()
|
||||
|
||||
if (WIN32 AND MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE=1)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE=1 -DNOMINMAX)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND MINGW)
|
||||
|
@ -934,14 +942,7 @@ endif()
|
|||
|
||||
if(ENABLE_MULTIBUILD)
|
||||
if(WIN32 AND MSVC)
|
||||
if(MSVC_VERSION GREATER 1600) # if > VC13
|
||||
message("The project must be compiled with VS2013 or older. VS2015 has deprecated many functions that we still use.")
|
||||
set(CMAKE_GENERATOR_TOOLSET "v120" CACHE STRING "Platform Toolset" FORCE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:MSVCRT")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:MSVCRT")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:MSVCRT")
|
||||
endif()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
message(STATUS "Added parallel build arguments to CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1238,8 +1239,13 @@ endif()
|
|||
########### next target ###############
|
||||
|
||||
if(WIN32 AND ENABLE_NSIS AND MAKENSIS_FOUND)
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/COPYING DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/COPYING DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/win32/stratagus.ico DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
if(WITH_FLUIDSYNTH AND FLUIDSYNTH_FOUND)
|
||||
file(COPY ${FLUIDSYNTH_DLL} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(COPY ${GLIB_DLL} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
file(COPY ${GTHREAD_DLL} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
add_custom_command(OUTPUT Stratagus-${STRATAGUS_VERSION}${MAKENSIS_SUFFIX}
|
||||
COMMAND ${MAKENSIS} ARGS ${MAKENSIS_FLAGS} -DVERSION=${STRATAGUS_VERSION} -DVIVERSION=${STRATAGUS_VERSION_FULL} ${CMAKE_CURRENT_SOURCE_DIR}/src/win32/stratagus.nsi
|
||||
DEPENDS src/win32/stratagus.nsi stratagus COPYING
|
||||
|
|
24
appveyor.yml
24
appveyor.yml
|
@ -1,10 +1,24 @@
|
|||
environment:
|
||||
VisualStudioVersion: 12.0
|
||||
shallow_clone: true
|
||||
configuration:
|
||||
- Release
|
||||
before_build:
|
||||
- mkdir build
|
||||
- cd build
|
||||
- appveyor DownloadFile http://stratagus.sourceforge.net/msvc-libs.zip
|
||||
- 7z x msvc-libs.zip
|
||||
- cmake -G "Visual Studio 12 2013" -DCMAKE_PREFIX_PATH="%cd%\\3rd" ..
|
||||
- appveyor DownloadFile https://github.com/Wargus/stratagus/releases/download/2015-30-11/dependencies.zip
|
||||
- 7z x dependencies.zip
|
||||
- choco install nsis -pre
|
||||
- cmake -G "Visual Studio 14 2015" -DCMAKE_PREFIX_PATH="%cd%\\dependencies" -DENABLE_NSIS=ON ..
|
||||
- cd ..
|
||||
artifacts:
|
||||
- path: build\Stratagus-*.exe
|
||||
deploy:
|
||||
release: master-builds
|
||||
description: 'Automatic builds from the master branch'
|
||||
provider: GitHub
|
||||
auth_token:
|
||||
secure: NMy2KE3EpZTjverxNzEAoBnlV+7VLGvwy3e1WEIrliFy3R1oxuT+AgGUDcRwv9y/
|
||||
artifact: /.*exe/
|
||||
draft: false
|
||||
prerelease: true
|
||||
on:
|
||||
branch: master
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
if(MAKENSIS)
|
||||
set(MAKENSIS_FOUND true)
|
||||
else()
|
||||
find_program(MAKENSIS NAMES makensis)
|
||||
find_program(MAKENSIS NAMES makensis HINTS "C:/Program Files/NSIS" "C:/Program Files (x86)/NSIS")
|
||||
find_package(SelfPackers)
|
||||
|
||||
set(MAKENSIS_ADDITIONAL_FLAGS "" CACHE STRING "Additional flags for makensis")
|
||||
|
|
|
@ -19,8 +19,8 @@ include (CheckLibraryExists)
|
|||
find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
|
||||
find_path(OGG_INCLUDE_DIR ogg/ogg.h)
|
||||
|
||||
find_library(OGG_LIBRARY NAMES ogg ogg_static)
|
||||
find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static)
|
||||
find_library(OGG_LIBRARY NAMES libogg libogg_static ogg ogg_static)
|
||||
find_library(VORBIS_LIBRARY NAMES libvorbis libvorbis_static vorbis vorbis_static)
|
||||
|
||||
mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
|
||||
OGG_LIBRARY VORBIS_LIBRARY)
|
||||
|
|
|
@ -13,11 +13,11 @@ endif(THEORA_INCLUDE_DIR AND THEORA_LIB_LIBRARIES AND THEORA_VORBIS_LIBRARIES AN
|
|||
|
||||
FIND_PATH(THEORA_INCLUDE_DIR theora/theora.h)
|
||||
|
||||
FIND_LIBRARY(THEORA_OGG_LIBRARIES NAMES ogg)
|
||||
FIND_LIBRARY(THEORA_OGG_LIBRARIES NAMES libogg libogg_static ogg ogg_static)
|
||||
|
||||
FIND_LIBRARY(THEORA_VORBIS_LIBRARIES NAMES vorbis vorbis_static)
|
||||
FIND_LIBRARY(THEORA_VORBIS_LIBRARIES NAMES libvorbis libvorbis_static vorbis vorbis_static)
|
||||
|
||||
FIND_LIBRARY(THEORA_LIB_LIBRARIES NAMES theora theora_static)
|
||||
FIND_LIBRARY(THEORA_LIB_LIBRARIES NAMES libtheora libtheora_static theora theora_static)
|
||||
|
||||
if(THEORA_LIB_LIBRARIES AND THEORA_VORBIS_LIBRARIES AND THEORA_OGG_LIBRARIES AND THEORA_INCLUDE_DIR)
|
||||
set(THEORA_LIBRARY ${THEORA_LIB_LIBRARIES} ${THEORA_OGG_LIBRARIES} ${THEORA_VORBIS_LIBRARIES})
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOUSER
|
||||
#define NOMINMAX // do not use min, max as macro
|
||||
|
||||
#if _MSC_VER >= 1800
|
||||
// From VS2013 onwards, std::min/max are only defined if algorithm is included
|
||||
|
|
|
@ -1160,7 +1160,8 @@ static int CclSetUnitVariable(lua_State *l)
|
|||
const char *const name = LuaToString(l, 2);
|
||||
int value;
|
||||
if (!strcmp(name, "Player")) {
|
||||
unit->AssignToPlayer(Players[LuaToNumber(l, 3)]);
|
||||
value = LuaToNumber(l, 3);
|
||||
unit->AssignToPlayer(Players[value]);
|
||||
} else if (!strcmp(name, "RegenerationRate")) {
|
||||
value = LuaToNumber(l, 3);
|
||||
unit->Variable[HP_INDEX].Increase = std::min(unit->Variable[HP_INDEX].Max, value);
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
!define SDL "SDL.dll"
|
||||
!ifndef NO_DOWNLOAD
|
||||
!system 'powershell -Command "& {wget https://www.libsdl.org/release/SDL-1.2.15-win32.zip -O SDL.zip}"'
|
||||
!system 'powershell -Command "& {wget https://www.libsdl.org/release/SDL-1.2.15-win32.zip -OutFile SDL.zip}"'
|
||||
!system 'powershell -Command "& {unzip -o SDL.zip SDL.dll}"'
|
||||
!endif
|
||||
|
||||
|
@ -92,9 +92,6 @@ ${redefine} NAME "Stratagus (64 bit)"
|
|||
|
||||
!endif
|
||||
|
||||
!ifdef FLUID
|
||||
!define FLUIDDLL "libfluidsynth.dll"
|
||||
!endif
|
||||
!define REGKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${NAME}"
|
||||
|
||||
;--------------------------------
|
||||
|
@ -228,6 +225,8 @@ Section "${NAME}"
|
|||
File "${SDL}"
|
||||
!ifdef FLUID
|
||||
File "${FLUIDDLL}"
|
||||
File "${GLIBDLL}"
|
||||
File "${GTHREADDLL}"
|
||||
!endif
|
||||
WriteRegStr HKLM "${REGKEY}" "DisplayName" "${NAME}"
|
||||
WriteRegStr HKLM "${REGKEY}" "UninstallString" "$\"$INSTDIR\${UNINSTALL}$\""
|
||||
|
|
Loading…
Add table
Reference in a new issue