added wolfssl and updated curl to the windows build for now

This commit is contained in:
Jackeri 2021-01-20 20:48:57 +02:00
parent 956384e913
commit fd4d153710
4 changed files with 128 additions and 36 deletions

19
CMake-MS-static-patch.txt Normal file
View file

@ -0,0 +1,19 @@
#MSVC patch
if(MSVC)
message(STATUS "Patching MSVC build for static linking")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHsc /O2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /EHa /W3")
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
endif()

View file

@ -1,8 +1,9 @@
include(ExternalProject) include(ExternalProject)
include(CheckIncludeFile) include(CheckIncludeFile)
set(LIBS_BINARYDIR_DIR ${PROJECT_BINARY_DIR}/libs) set(LIBS_BINARY_DIR ${PROJECT_BINARY_DIR}/libs)
set(LIBS_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads) set(LIBS_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads/pgk)
set(LIBS_DOWNLOAD_SRC_DIR ${PROJECT_BINARY_DIR}/downloads/src)
# note/FIXME/clarify: # note/FIXME/clarify:
# when features are disabled this script is still # when features are disabled this script is still
@ -30,10 +31,50 @@ foreach (_variableName ${_variableNames})
endif() endif()
endforeach() endforeach()
if(FEATURE_SSL AND BUNDLED_WOLFSSL)
message(STATUS "Configuring wolfSSL")
if(VSTUDIO)
set(WOLFSSL_BUNDLED_LIBRARY optimized "${LIBS_BINARY_DIR}/wolfssl/Release/wolfssl${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARY_DIR}/wolfssl/Debug/wolfssl${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(VS_BUILD)
set(WOLFSSL_BUNDLED_LIBRARY "${LIBS_BINARY_DIR}/wolfssl/lib/wolfssl${CMAKE_STATIC_LIBRARY_SUFFIX}")
else()
set(WOLFSSL_BUNDLED_LIBRARY "${LIBS_BINARY_DIR}/wolfssl/lib/libwolfssl${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif()
if(MSVC)
set(WOLFSSL_PATCH_COMMAND "${CMAKE_CURRENT_LIST_DIR}/patcher.bat" "${LIBS_DOWNLOAD_SRC_DIR}/wolfssl/CMakeLists.txt")
else()
set(WOLFSSL_PATCH_COMMAND "")
endif()
ExternalProject_Add(bundled_wolfssl
DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}
URL https://github.com/wolfSSL/wolfssl/archive/v4.6.0-stable.tar.gz
URL_HASH MD5=99f09fce6739a6dcb7554d2c2588e4c1
SOURCE_DIR "${LIBS_DOWNLOAD_SRC_DIR}/wolfssl"
PATCH_COMMAND ${WOLFSSL_PATCH_COMMAND}
BINARY_DIR ${LIBS_BINARY_DIR}/wolfssl
BUILD_BYPRODUCTS ${WOLFSSL_BUNDLED_LIBRARY}
PREFIX ${LIBS_BINARY_DIR}/wolfssl
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}"
-DWOLFSSL_EXAMPLES=OFF -DWOLFSSL_CRYPT_TESTS=OFF
-DCMAKE_INSTALL_PREFIX=${LIBS_BINARY_DIR}/wolfssl
)
set(WOLFSSL_BUNDLED_INCLUDE_DIR "${LIBS_BINARY_DIR}/wolfssl/include" "${LIBS_BINARY_DIR}/wolfssl/include/wolfssl")
set_target_properties(bundled_wolfssl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
else()
add_custom_target(bundled_wolfssl)
set_target_properties(bundled_wolfssl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
endif()
if(WIN32) if(WIN32)
# moved for now until linux BUNDLED_OPENSSL is done # moved for now until linux BUNDLED_OPENSSL is done
if(BUNDLED_OPENSSL) if(FEATURE_SSL AND BUNDLED_OPENSSL)
find_program(NASM_EXECUTABLE nasm) find_program(NASM_EXECUTABLE nasm)
if(NOT NASM_EXECUTABLE) if(NOT NASM_EXECUTABLE)
message(FATAL_ERROR "NASM not found") message(FATAL_ERROR "NASM not found")
@ -56,8 +97,8 @@ if(WIN32)
endif() endif()
endif() endif()
if(BUNDLED_OPENSSL AND (BUILD_CLIENT OR BUILD_SERVER)) if(FEATURE_SSL AND BUNDLED_OPENSSL AND (BUILD_CLIENT OR BUILD_SERVER))
set(OPENSSL_PREFIX "${CMAKE_BINARY_DIR}/openssl/build") set(OPENSSL_PREFIX "${LIBS_DOWNLOAD_SRC_DIR}/openssl/build")
set(OPENSSL_CONFIGURE "${PERL_EXECUTABLE}" Configure "${openssl_plat}" "--prefix=${OPENSSL_PREFIX}" "--openssldir=${OPENSSL_PREFIX}" no-shared no-unit-test -static) set(OPENSSL_CONFIGURE "${PERL_EXECUTABLE}" Configure "${openssl_plat}" "--prefix=${OPENSSL_PREFIX}" "--openssldir=${OPENSSL_PREFIX}" no-shared no-unit-test -static)
set(OPENSSL_BUILD nmake) set(OPENSSL_BUILD nmake)
set(OPENSSL_INSTALL nmake install) set(OPENSSL_INSTALL nmake install)
@ -66,9 +107,9 @@ if(WIN32)
# Use github archive instead of the one hosted on openssl.org because of CMake bug #13251 # Use github archive instead of the one hosted on openssl.org because of CMake bug #13251
#URL_MD5 "76766e98997660138cdaf13a187bd234" #URL_MD5 "76766e98997660138cdaf13a187bd234"
#GIT_REPOSITORY "https://github.com/openssl/openssl.git" #GIT_REPOSITORY "https://github.com/openssl/openssl.git"
DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}/openssl DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}
URL https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz URL https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz
SOURCE_DIR "${CMAKE_BINARY_DIR}/openssl" SOURCE_DIR "${LIBS_DOWNLOAD_SRC_DIR}/openssl"
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ${OPENSSL_CONFIGURE} CONFIGURE_COMMAND ${OPENSSL_CONFIGURE}
BUILD_COMMAND ${OPENSSL_BUILD} BUILD_COMMAND ${OPENSSL_BUILD}
@ -86,7 +127,7 @@ if(WIN32)
# Build bundled cURL library # Build bundled cURL library
#----------------------------------------------------------------- #-----------------------------------------------------------------
if(BUNDLED_CURL AND (BUILD_CLIENT OR BUILD_SERVER)) if(BUNDLED_CURL AND (BUILD_CLIENT OR BUILD_SERVER))
set(binary_dir "${LIBS_BINARYDIR_DIR}/curl") set(binary_dir "${LIBS_BINARY_DIR}/curl")
if(VSTUDIO) if(VSTUDIO)
set(CURL_BUNDLED_LIBRARY optimized "${binary_dir}/lib/Release/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/lib/Debug/libcurl-d${CMAKE_STATIC_LIBRARY_SUFFIX}") set(CURL_BUNDLED_LIBRARY optimized "${binary_dir}/lib/Release/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/lib/Debug/libcurl-d${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(MINGW OR VS_BUILD) elseif(MINGW OR VS_BUILD)
@ -95,22 +136,50 @@ if(WIN32)
set(CURL_BUNDLED_LIBRARY "${binary_dir}/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}") set(CURL_BUNDLED_LIBRARY "${binary_dir}/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif(VSTUDIO) endif(VSTUDIO)
# -DHTTP_ONLY=1 set(CURL_CMAKE_ARGS
ExternalProject_Add(bundled_curl -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
DEPENDS bundled_openssl
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/curl
BINARY_DIR ${binary_dir}
BUILD_BYPRODUCTS ${CURL_BUNDLED_LIBRARY}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DBUILD_CURL_EXE=0 -DBUILD_SHARED_LIBS=0 -DENABLE_ARES=0 -DENABLE_THREADED_RESOLVER=1 -DENABLE_DEBUG=0 -DBUILD_CURL_EXE=0 -DBUILD_SHARED_LIBS=0 -DENABLE_ARES=0 -DENABLE_THREADED_RESOLVER=1 -DENABLE_DEBUG=0
-DENABLE_CURLDEBUG=0 -DBUILD_TESTING=0 -DENABLE_IPV6=1 -DENABLE_MANUAL=0 -DCMAKE_USE_LIBSSH2=0 -DENABLE_CURLDEBUG=0 -DBUILD_TESTING=0 -DENABLE_IPV6=1 -DENABLE_MANUAL=0 -DCMAKE_USE_LIBSSH2=0
-DUSE_NGHTTP2=0 -DCURL_WINDOWS_SSPI=0 -DCURL_ZLIB=1 -DCMAKE_USE_GSSAPI=0 -DUSE_NGHTTP2=0 -DCURL_WINDOWS_SSPI=0 -DCURL_ZLIB=AUTO -DCMAKE_USE_GSSAPI=0
-DCURL_DISABLE_LDAP=1 -DCURL_DISABLE_LDAPS=1 -DCURL_DISABLE_TELNET=1 -DCURL_DISABLE_DICT=1 -DCURL_DISABLE_LDAP=1 -DCURL_DISABLE_LDAPS=1 -DCURL_DISABLE_TELNET=1 -DCURL_DISABLE_DICT=1
-DCURL_DISABLE_FILE=1 -DCURL_DISABLE_TFTP=1 -DCURL_DISABLE_RTSP=1 -DCURL_DISABLE_POP3=1 -DCURL_DISABLE_IMAP=1 -DCURL_DISABLE_FILE=1 -DCURL_DISABLE_TFTP=1 -DCURL_DISABLE_RTSP=1 -DCURL_DISABLE_POP3=1
-DCURL_DISABLE_SMTP=1 -DCURL_DISABLE_GOPHER=1 -DCURL_DISABLE_IMAP=1 -DCURL_DISABLE_SMTP=1 -DCURL_DISABLE_GOPHER=1
-DOPENSSL_ROOT_DIR=${OPENSSL_PREFIX} -DCMAKE_USE_OPENSSL=${FEATURE_OPENSSL} -DCURL_STATIC_CRT=1 -DENABLE_UNIX_SOCKETS=1
-DENABLE_UNIX_SOCKETS=1 -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/curl -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/curl)
if(FEATURE_SSL)
if(BUNDLED_WOLFSSL)
include(CheckTypeSize)
check_type_size("long long" SIZEOF_LONG_LONG)
list(APPEND CURL_CMAKE_ARGS
-DCMAKE_C_FLAGS=-DSIZEOF_LONG_LONG=${SIZEOF_LONG_LONG}
-DCMAKE_USE_OPENSSL=OFF -DCURL_DISABLE_CRYPTO_AUTH=ON
-DCMAKE_USE_WOLFSSL=ON
-DCMAKE_LIBRARY_PATH=${LIBS_BINARY_DIR}/wolfssl
-DWolfSSL_INCLUDE_DIR=${WOLFSSL_BUNDLED_INCLUDE_DIR}
)
elseif(BUNDLED_OPENSSL)
list(APPEND CURL_CMAKE_ARGS -DOPENSSL_ROOT_DIR=${OPENSSL_PREFIX} -DCMAKE_USE_OPENSSL=ON)
else()
list(APPEND CURL_CMAKE_ARGS -DCMAKE_USE_OPENSSL=ON)
endif()
else()
list(APPEND CURL_CMAKE_ARGS -DCMAKE_USE_OPENSSL=OFF)
endif()
# -DHTTP_ONLY=1
ExternalProject_Add(bundled_curl
DEPENDS bundled_wolfssl bundled_openssl
DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}
URL https://github.com/curl/curl/archive/curl-7_74_0.tar.gz
URL_HASH MD5=f9eb1ef3867584da7c8dc5f57ed4d95f
# SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/curl
SOURCE_DIR "${LIBS_DOWNLOAD_SRC_DIR}/curl"
BINARY_DIR ${binary_dir}
BUILD_BYPRODUCTS ${CURL_BUNDLED_LIBRARY}
CMAKE_ARGS ${CURL_CMAKE_ARGS}
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
@ -283,7 +352,7 @@ if(WIN32)
# Build bundled OpenAL library # Build bundled OpenAL library
#----------------------------------------------------------------- #-----------------------------------------------------------------
if(BUNDLED_OPENAL AND BUILD_CLIENT) if(BUNDLED_OPENAL AND BUILD_CLIENT)
set(binary_dir "${LIBS_BINARYDIR_DIR}/openal") set(binary_dir "${LIBS_BINARY_DIR}/openal")
if(VSTUDIO) if(VSTUDIO)
set(OPENAL_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}") set(OPENAL_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(VS_BUILD) elseif(VS_BUILD)
@ -505,7 +574,7 @@ elseif(UNIX)
if(BUNDLED_OPENAL AND BUILD_CLIENT) if(BUNDLED_OPENAL AND BUILD_CLIENT)
ExternalProject_Add(bundled_openal ExternalProject_Add(bundled_openal
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/openal SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/openal
BINARY_DIR ${LIBS_BINARYDIR_DIR}/openal BINARY_DIR ${LIBS_BINARY_DIR}/openal
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/openal -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/openal
@ -536,9 +605,9 @@ if(BUNDLED_SDL AND BUILD_CLIENT)
endif() endif()
if(CMAKE_SYSTEM MATCHES "Darwin" OR WIN32) if(CMAKE_SYSTEM MATCHES "Darwin" OR WIN32)
set(SDL32_BUNDLED_LIBRARIES optimized "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2maind${CMAKE_STATIC_LIBRARY_SUFFIX}") set(SDL32_BUNDLED_LIBRARIES optimized "${LIBS_BINARY_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARY_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2maind${CMAKE_STATIC_LIBRARY_SUFFIX}")
endif() endif()
set(SDL32_BUNDLED_LIBRARIES ${SDL32_BUNDLED_LIBRARIES} optimized "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2d${CMAKE_STATIC_LIBRARY_SUFFIX}") set(SDL32_BUNDLED_LIBRARIES ${SDL32_BUNDLED_LIBRARIES} optimized "${LIBS_BINARY_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARY_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2d${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(SDL_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} set(SDL_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}" -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}"
@ -546,7 +615,7 @@ if(BUNDLED_SDL AND BUILD_CLIENT)
-DVIDEO_DUMMY=OFF -DVIDEO_OPENGL=ON -DVIDEO_OPENGLES=${SDL_WITH_GLES} -DVIDEO_VULKAN=OFF -DVIDEO_METAL=OFF -DVIDEO_DUMMY=OFF -DVIDEO_OPENGL=ON -DVIDEO_OPENGLES=${SDL_WITH_GLES} -DVIDEO_VULKAN=OFF -DVIDEO_METAL=OFF
-DVIDEO_KMSDRM=OFF -DVIDEO_WAYLAND=OFF -DVIDEO_X11_XINPUT=OFF -DVIDEO_KMSDRM=OFF -DVIDEO_WAYLAND=OFF -DVIDEO_X11_XINPUT=OFF
-DSDL_SHARED=OFF -DFORCE_STATIC_VCRT=ON -DSNDIO=OFF -DHAVE_LIBC=ON -DSDL_SHARED=OFF -DFORCE_STATIC_VCRT=ON -DSNDIO=OFF -DHAVE_LIBC=ON
-DCMAKE_INSTALL_PREFIX=${LIBS_BINARYDIR_DIR}/sdl2) -DCMAKE_INSTALL_PREFIX=${LIBS_BINARY_DIR}/sdl2)
# Bye bye X11 # Bye bye X11
if(APPLE) if(APPLE)
@ -555,17 +624,17 @@ if(BUNDLED_SDL AND BUILD_CLIENT)
ExternalProject_Add(bundled_sdl ExternalProject_Add(bundled_sdl
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/sdl2 SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/sdl2
# DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}/sdl2 # DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}
# URL https://www.libsdl.org/release/SDL2-2.0.12.tar.gz # URL https://www.libsdl.org/release/SDL2-2.0.12.tar.gz
BINARY_DIR ${LIBS_BINARYDIR_DIR}/sdl2 BINARY_DIR ${LIBS_BINARY_DIR}/sdl2
BUILD_BYPRODUCTS ${SDL32_BUNDLED_LIBRARIES} BUILD_BYPRODUCTS ${SDL32_BUNDLED_LIBRARIES}
CMAKE_ARGS ${SDL_CMAKE_ARGS} CMAKE_ARGS ${SDL_CMAKE_ARGS}
PREFIX ${LIBS_BINARYDIR_DIR}/sdl2 PREFIX ${LIBS_BINARY_DIR}/sdl2
) )
#ExternalProject_Get_Property(bundled_sdl binary_dir) #ExternalProject_Get_Property(bundled_sdl binary_dir)
set(SDL32_BUNDLED_INCLUDE_DIR "${LIBS_BINARYDIR_DIR}/sdl2/include") set(SDL32_BUNDLED_INCLUDE_DIR "${LIBS_BINARY_DIR}/sdl2/include")
set_target_properties(bundled_sdl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER}) set_target_properties(bundled_sdl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
endif() endif()
@ -660,7 +729,7 @@ if(BUNDLED_JPEG AND BUILD_CLIENT)
check_include_file(stddef.h HAVE_STDDEF_H) check_include_file(stddef.h HAVE_STDDEF_H)
check_include_file(stdlib.h HAVE_STDLIB_H) check_include_file(stdlib.h HAVE_STDLIB_H)
set(binary_dir "${LIBS_BINARYDIR_DIR}/jpegturbo") set(binary_dir "${LIBS_BINARY_DIR}/jpegturbo")
if(VSTUDIO) if(VSTUDIO)
set(JPEG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/turbojpeg-static${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/turbojpeg-static${CMAKE_STATIC_LIBRARY_SUFFIX}") set(JPEG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/turbojpeg-static${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/turbojpeg-static${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(VS_BUILD) elseif(VS_BUILD)
@ -683,7 +752,7 @@ if(BUNDLED_JPEG AND BUILD_CLIENT)
ExternalProject_Add(bundled_jpeg ExternalProject_Add(bundled_jpeg
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/jpegturbo SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/jpegturbo
BINARY_DIR ${LIBS_BINARYDIR_DIR}/jpegturbo BINARY_DIR ${LIBS_BINARY_DIR}/jpegturbo
BUILD_BYPRODUCTS ${JPEG_BUNDLED_LIBRARIES} BUILD_BYPRODUCTS ${JPEG_BUNDLED_LIBRARIES}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
@ -704,7 +773,7 @@ endif()
# Build bundled PNG library # Build bundled PNG library
#----------------------------------------------------------------- #-----------------------------------------------------------------
if(BUNDLED_PNG AND BUILD_CLIENT) if(BUNDLED_PNG AND BUILD_CLIENT)
set(binary_dir "${LIBS_BINARYDIR_DIR}/libpng") set(binary_dir "${LIBS_BINARY_DIR}/libpng")
if(VSTUDIO) if(VSTUDIO)
set(PNG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}") set(PNG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(VS_BUILD) elseif(VS_BUILD)
@ -719,7 +788,7 @@ if(BUNDLED_PNG AND BUILD_CLIENT)
ExternalProject_Add(bundled_png ExternalProject_Add(bundled_png
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/libpng SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/libpng
BINARY_DIR ${LIBS_BINARYDIR_DIR}/libpng BINARY_DIR ${LIBS_BINARY_DIR}/libpng
BUILD_BYPRODUCTS ${PNG_BUNDLED_LIBRARIES} BUILD_BYPRODUCTS ${PNG_BUNDLED_LIBRARIES}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
@ -738,7 +807,7 @@ endif()
# Build bundled Freetype library # Build bundled Freetype library
#----------------------------------------------------------------- #-----------------------------------------------------------------
if(BUNDLED_FREETYPE AND BUILD_CLIENT) if(BUNDLED_FREETYPE AND BUILD_CLIENT)
set(binary_dir "${LIBS_BINARYDIR_DIR}/freetype") set(binary_dir "${LIBS_BINARY_DIR}/freetype")
if(VSTUDIO) if(VSTUDIO)
set(BUNDLED_FREETYPE_LIBRARIES optimized "${binary_dir}/Release/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}") set(BUNDLED_FREETYPE_LIBRARIES optimized "${binary_dir}/Release/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(VS_BUILD) elseif(VS_BUILD)

View file

@ -395,7 +395,7 @@ if(MSVC)
foreach(CompilerFlag ${CompilerFlags}) foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach() endforeach()
endif(MSVC) endif()
if (BUILD_FRAMEWORK) if (BUILD_FRAMEWORK)
list(APPEND BASE_SRCS builds/mac/freetype-Info.plist) list(APPEND BASE_SRCS builds/mac/freetype-Info.plist)

4
patcher.bat Normal file
View file

@ -0,0 +1,4 @@
@ECHO OFF
setlocal
cd /d %~dp0
type CMake-MS-static-patch.txt >> %1