Merge with develop

--HG--
branch : compatibility-develop
This commit is contained in:
kervala 2017-10-01 15:37:51 +02:00
commit ac7474c7ba
115 changed files with 709 additions and 191 deletions

View file

@ -28,10 +28,6 @@ IF(COMMAND cmake_policy)
# have absolute paths (e.g. -lpthread)
cmake_policy(SET CMP0003 NEW)
# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements
cmake_policy(SET CMP0005 OLD)
# allow to link to qtmain automatically under Windows
IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
@ -451,6 +447,8 @@ IF(WITH_NEL)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
ENDIF()
ENDIF()
ELSEIF(WIN32)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} Crypt32.lib)
ENDIF()
ENDIF()
ENDIF()

View file

@ -28,14 +28,14 @@ IF(TARGET_CPU STREQUAL "armv7")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4)
SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(LIBRARY_ARCHITECTURE "armeabi")
SET(CMAKE_SYSTEM_PROCESSOR "armv5")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4)
SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "arm64")
SET(LIBRARY_ARCHITECTURE "arm64-v8a")
SET(CMAKE_SYSTEM_PROCESSOR "arm64")
@ -76,14 +76,9 @@ ELSE()
ENDIF()
SET(CLANG_TOOLCHAIN_PREFIX "llvm")
SET(ANDROID_COMPILER "GCC")
IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang")
SET(ANDROID_COMPILER "clang")
SET(ANDROID_COMPILER "clang")
SET(CLANG ON)
ELSE()
SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION})
ENDIF()
IF(NOT NDK_TARGET)
SET(NDK_TARGET ${MINIMUM_NDK_TARGET})
@ -94,88 +89,71 @@ ELSE()
ENDIF()
IF(CMAKE_HOST_WIN32)
SET(TOOLCHAIN_HOST "windows")
SET(TOOLCHAIN_HOST "windows-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX ".exe")
ELSEIF(CMAKE_HOST_APPLE)
SET(TOOLCHAIN_HOST "apple")
SET(TOOLCHAIN_BIN_SUFFIX "")
ELSEIF(CMAKE_HOST_UNIX)
SET(TOOLCHAIN_HOST "linux")
SET(TOOLCHAIN_HOST "linux-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX "")
ENDIF()
MACRO(SEARCH_TOOLCHAIN _COMPILER)
SET(${_COMPILER}_TOOLCHAIN_VERSIONS)
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*")
# clang
SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
IF(EXISTS ${CLANG_TOOLCHAIN_ROOT})
MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
ELSE()
MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}")
ENDIF()
# gcc
SET(GCC_TOOLCHAIN_VERSIONS)
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF()
ENDFOREACH()
ENDIF()
# try prefixes without version
SET(_TOOLCHAIN_WITHOUT_VERSION "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}")
IF(EXISTS ${_TOOLCHAIN_WITHOUT_VERSION})
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS "default")
IF(NOT GCC_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains")
ENDIF()
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
ENDIF()
IF(${_COMPILER}_TOOLCHAIN_VERSIONS)
LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX)
IF(GCC_TOOLCHAIN_VERSIONS)
LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX)
IF(_INDEX EQUAL -1)
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF()
ELSE()
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF()
MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}")
SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default")
MESSAGE(STATUS "default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
ELSE()
MESSAGE(STATUS "not default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
ENDIF()
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
IF(NOT EXISTS "${GCC_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}*")
IF(_TOOLCHAIN_PREFIXES)
LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT)
LIST(GET _TOOLCHAIN_PREFIXES 0 GCC_TOOLCHAIN_ROOT)
ENDIF()
ENDIF()
ENDMACRO()
IF(CLANG)
SEARCH_TOOLCHAIN(CLANG)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}")
ENDIF()
SEARCH_TOOLCHAIN(GCC)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}")
IF(CLANG_TOOLCHAIN_ROOT)
MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
ENDIF()
IF(GCC_TOOLCHAIN_ROOT)
MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
IF(EXISTS "${GCC_TOOLCHAIN_ROOT}")
MESSAGE(STATUS "Found GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
ELSE()
MESSAGE(FATAL_ERROR "No GCC toolchain found in default search path ${GCC_TOOLCHAIN_ROOT}")
ENDIF()
# NDK
SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}")
MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}")
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}")
# include dirs
SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include")
@ -208,17 +186,18 @@ MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
ENDMACRO()
# Force the compilers to GCC for Android
include (CMakeForceCompiler)
IF(CLANG)
MESSAGE(STATUS "Using clang compiler")
SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET(CMAKE_C_COMPILER_FORCED TRUE)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
SET(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
@ -231,19 +210,6 @@ IF(CLANG)
IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
ENDIF()
ELSE()
MESSAGE(STATUS "Using GCC compiler")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_C_COMPILER gcc)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_CXX_COMPILER g++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_LINKER ld)
ENDIF()
SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_NM nm)

View file

@ -5,6 +5,24 @@
# VC_LIBRARY_DIR - where to find libraries
# VC_FOUND - True if MSVC found.
MACRO(ADD_TRAILING_SLASH _FILENAME_VAR)
# put content in a new variable
SET(_FILENAME ${${_FILENAME_VAR}})
# get length of the string
STRING(LENGTH ${_FILENAME} _LEN)
# convert length to last pos
MATH(EXPR _POS "${_LEN}-1")
# get last character of the string
STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END)
# compare it with a slash
IF(NOT _FILENAME_END STREQUAL "/")
# not a slash, append it
SET(${_FILENAME_VAR} "${_FILENAME}/")
ELSE()
# already a slash
ENDIF()
ENDMACRO()
MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
# Software/Wow6432Node/...
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
@ -12,7 +30,11 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_DIR)
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
# be sure it's finishing by a /
ADD_TRAILING_SLASH(VC${_VERSION}_DIR)
SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
ENDIF()
ENDIF()
@ -55,7 +77,34 @@ MACRO(DETECT_EXPRESS_VERSION _VERSION)
ENDIF()
ENDMACRO()
IF(MSVC14)
IF(MSVC1411 OR MSVC1410)
DETECT_VC_VERSION("15.0")
SET(MSVC_TOOLSET "140")
SET(VC_DIR "${VC_DIR}Tools/MSVC")
FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
IF(MSVC_TOOLCHAIN_VERSIONS)
LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
ENDIF()
IF(NOT MSVC_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}")
ENDIF()
LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
IF(NOT MSVC14_REDIST_DIR)
# If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist
# original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT
SET(MSVC14_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF()
ELSEIF(MSVC14)
DETECT_VC_VERSION("14.0")
SET(MSVC_TOOLSET "140")
@ -109,6 +158,11 @@ IF(NOT VC_DIR)
STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER})
ENDIF()
IF(NOT VC_INCLUDE_DIR)
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
ENDIF()
MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}")
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})

View file

@ -35,7 +35,7 @@ MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX)
SET(WINSDK${_VERSION}_FOUND ON)
SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}")
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
ENDIF()
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ELSE()
@ -240,7 +240,11 @@ MACRO(USE_CURRENT_WINSDK)
IF(NOT WINSDK_DIR)
# Use Windows SDK versions installed with VC++ when possible
IF(MSVC14)
IF(MSVC1411 OR MSVC1410)
# Special case, use Kits for SDK
SET(WINSDK_VERSION "10.0")
SET(WINSDK_DIR ${WINSDK_UCRT_DIR})
ELSEIF(MSVC14)
SET(WINSDK_VERSION "8.1")
ELSEIF(MSVC12)
SET(WINSDK_VERSION "8.1")
@ -305,7 +309,7 @@ MACRO(USE_CURRENT_WINSDK)
ENDMACRO()
IF(MSVC14)
# Under VC++ 2015, stdio.h, stdlib.h, etc... are part of UCRT
# Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT
SET(WINSDK_UCRT_VERSION "10.0")
ENDIF()
@ -314,6 +318,40 @@ IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND)
SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}")
ENDIF()
IF(WINSDK_UCRT_DIR)
# determine exact UCRT version
SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
SET(UCRT_VERSION)
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
SET(UCRT_VERSION ${UCRT_SUBDIR})
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
SET(WINSDK10_INCLUDE_DIR ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION})
SET(WINSDK10_LIBRARY_DIR ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION})
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK10_INCLUDE_DIR}/ucrt
)
# directory where UCRT libraries are found
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
HINTS
${WINSDK10_LIBRARY_DIR}/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
IF(WINSDK_VERSION STREQUAL "CURRENT")
USE_CURRENT_WINSDK()
ELSE()
@ -334,93 +372,87 @@ ENDIF()
# directory where Win32 headers are found
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/um
${WINSDK_DIR}/Include/um
${WINSDK_DIR}/Include
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}")
# directory where WinRT headers are found
FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h
HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt
${WINSDK_DIR}/Include/winrt
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}")
# directory where DirectX headers are found
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/shared
${WINSDK_DIR}/Include/shared
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}")
# directory where OpenGL headers are found
FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h
HINTS
${WINSDK_INCLUDE_DIR}/gl
${WINSDK_DIR}/Include/um/gl
${WINSDK_DIR}/Include/gl
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}")
SET(WINSDK_LIBRARY_DIRS
${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
)
IF(WINSDK_SUFFIXES)
FOREACH(_SUFFIX ${WINSDK_SUFFIXES})
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib/${_SUFFIX})
LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX})
ENDFOREACH()
ELSE()
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib)
LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib)
ENDIF()
# directory where all libraries are found
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS
${WINSDK_LIBRARY_DIRS}
NO_DEFAULT_PATH
)
IF(WINSDK_UCRT_DIR)
# determine exact UCRT version
SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_DIR}")
FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
SET(UCRT_VERSION)
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
SET(UCRT_VERSION ${UCRT_SUBDIR})
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt
SET(WINSDK_BINARY_DIRS
${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
)
# directory where UCRT libraries are found
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
HINTS
${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
# signtool is used to sign executables
FIND_PROGRAM(WINSDK_SIGNTOOL signtool
HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
${WINSDK_BINARY_DIRS}
NO_DEFAULT_PATH
)
# midl is used to generate IDL interfaces
FIND_PROGRAM(WINSDK_MIDL midl
HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
${WINSDK_BINARY_DIRS}
NO_DEFAULT_PATH
)
IF(WINSDK_INCLUDE_DIR)
@ -444,7 +476,7 @@ IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR})
ENDIF()
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow...
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS})
IF(WINSDK_UCRT_LIBRARY_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})

View file

@ -114,12 +114,16 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps)
LIST(APPEND _FLAGS ${oldProps})
SET(_FLAG ${oldProps})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF()
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild)
LIST(APPEND _FLAGS ${oldPropsBuild})
SET(_FLAG ${oldPropsBuild})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF()
GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES)
@ -205,6 +209,10 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
ENDIF()
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0")
LIST(APPEND _FLAGS "-std=gnu++11")
ENDIF()
# Format definitions
IF(MSVC)
# Fix path with space
@ -316,7 +324,7 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
SET(_FLAGS "")
IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch)
SET(_FLAGS ${OBJC_FLAGS})
ENDIF()
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF()
@ -402,7 +410,8 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
ENDIF()
IF(APPLE)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}")
SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF()
IF(WITH_PCH_DEBUG)

View file

@ -35,23 +35,6 @@ SET(UNIX ON)
SET(APPLE ON)
SET(IOS ON)
# Force the compilers to Clang for iOS
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (clang Clang)
CMAKE_FORCE_CXX_COMPILER (clang++ Clang)
IF(CMAKE_CXX_COMPILER)
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE CLANG_VERSION_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "Apple LLVM version ([\\.0-9]+).*"
"\\1" CMAKE_CXX_COMPILER_VERSION "${CLANG_VERSION_RAW}")
SET(CMAKE_C_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
SET(CMAKE_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ENDIF()
# Setup iOS platform
IF(NOT DEFINED IOS_PLATFORM)
SET(IOS_PLATFORM "OS")
@ -162,14 +145,14 @@ IF(CMAKE_GENERATOR MATCHES Xcode)
ENDIF()
ELSE()
IF(${IOS_PLATFORM} STREQUAL "OS")
SET(ARCHS "armv7;arm64")
SET(ARCHS armv7 arm64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR")
# iPhone simulator targets i386
SET(ARCHS "i386")
SET(CMAKE_SYSTEM_PROCESSOR "x86")
ELSEIF(${IOS_PLATFORM} STREQUAL "ALL")
SET(ARCHS "armv7;arm64;i386;x86_64")
SET(ARCHS armv7 arm64 i386 x86_64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ENDIF()
ENDIF()
@ -198,5 +181,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Force the compilers to Clang for iOS
SET(CMAKE_C_COMPILER clang)
SET(CMAKE_CXX_COMPILER clang++)
# Skip the platform compiler checks for cross compiling.
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
include(CMakeFindBinUtils)
INCLUDE(CMakeFindBinUtils)

View file

@ -565,11 +565,18 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("/X")
IF(MSVC14)
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2015, but custom optimizations don't exist
ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2015 and 2017, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
# Special cases for VC++ 2017
IF(MSVC_VERSION EQUAL "1911")
SET(MSVC1411 ON)
ELSEIF(MSVC_VERSION EQUAL "1910")
SET(MSVC1410 ON)
ENDIF()
ELSEIF(MSVC12)
ADD_PLATFORM_FLAGS("/Gy-")
# /Ox is working with VC++ 2013, but custom optimizations don't exist
@ -657,6 +664,8 @@ MACRO(NL_SETUP_BUILD)
ENDIF()
IF(APPLE)
SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak)
IF(NOT XCODE)
IF(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 0)
@ -1160,6 +1169,7 @@ MACRO(SETUP_EXTERNAL)
IF(APPLE)
IF(WITH_STATIC_EXTERNAL)
# Look only for static libraries because systems libraries are using Frameworks
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
@ -1173,12 +1183,13 @@ MACRO(SETUP_EXTERNAL)
ENDIF()
ENDIF()
# Android and iOS have pthread
IF(ANDROID OR IOS)
# Android, iOS and Mac OS X have pthread, but no need to link to libpthread
IF(ANDROID OR APPLE)
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
ELSE()
FIND_PACKAGE(Threads REQUIRED)
SET(THREADS_HAVE_PTHREAD_ARG ON)
FIND_PACKAGE(Threads)
# TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT
ENDIF()

View file

@ -32,6 +32,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -480,12 +480,21 @@ public:
virtual ~CStateRecord() {}
// use STL allocator for fast alloc. this works because objects are small ( < 128 bytes)
void *operator new(size_t size) { return CStateRecord::Allocator.allocate(size); }
void *operator new(size_t size, int /* blockUse */, char const * /* fileName */, int /* lineNumber */)
{
// TODO: add memory leaks detector
return CStateRecord::Allocator.allocate(size);
}
void operator delete(void *block) { CStateRecord::Allocator.deallocate((uint8 *) block, 1); }
void operator delete(void *block, int /* blockUse */, char const* /* fileName */, int /* lineNumber */)
{
// TODO: add memory leaks detector
CStateRecord::Allocator.deallocate((uint8 *)block, 1);
}
static std::allocator<uint8> Allocator;
};
// record of a single .fx pass
class CFXPassRecord
{

View file

@ -25,6 +25,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -17,6 +17,10 @@
#include "stddirect3d.h"
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -27,6 +27,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -29,6 +29,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -19,6 +19,10 @@
#include "driver_direct3d.h"
#include "nel/misc/hierarchical_timer.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -27,6 +27,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -20,6 +20,10 @@
#include "nel/misc/path.h"
#include "nel/misc/file.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "driver_direct3d.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -24,6 +24,10 @@
#include "nel/georges/form.h"
#include "nel/georges/form_loader.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
namespace NLGEORGES

View file

@ -24,6 +24,10 @@
#include "nel/georges/form_loader.h"
#include "nel/georges/form_elm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -25,6 +25,10 @@
#include "nel/georges/form_loader.h"
#include "nel/georges/type.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -27,6 +27,10 @@
#include "nel/georges/form.h"
#include "nel/georges/form_dfn.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -22,6 +22,10 @@
#include "nel/georges/header.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
namespace NLGEORGES

View file

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDGEORGES_H
#define STDGEORGES_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include "nel/misc/types_nl.h"
#include <cmath>
#include <list>
@ -27,3 +37,5 @@
// Include from libxml2
#include <libxml/parser.h>
#endif

View file

@ -27,6 +27,10 @@
#include "nel/georges/form_loader.h"
#include "nel/georges/type.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -23,6 +23,10 @@
#include <windows.h>
#include <mmsystem.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -18,6 +18,9 @@
#include "listener_dsound.h"
#include "sound_driver_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;

View file

@ -31,6 +31,9 @@
#include "sound_driver_dsound.h"
#include "listener_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -21,6 +21,9 @@
#include "buffer_dsound.h"
#include "listener_dsound.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDDSOUND_H
#define STDDSOUND_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include "nel/misc/types_nl.h"
#define EAX_AVAILABLE 0
@ -44,4 +54,5 @@
#include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h"
#endif
/* end of file */

View file

@ -25,6 +25,10 @@
# include <mmsystem.h>
#endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -18,6 +18,9 @@
#include "listener_fmod.h"
#include "sound_driver_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "music_channel_fmod.h"
#include "sound_driver_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include <Windows.h>
#endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -21,6 +21,9 @@
#include "buffer_fmod.h"
#include "listener_fmod.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace std;

View file

@ -14,6 +14,16 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef STDFMOD_H
#define STDFMOD_H
#if defined(_MSC_VER) && defined(_DEBUG)
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
#include <nel/misc/types_nl.h>
#ifdef NL_OS_WINDOWS
@ -42,4 +52,6 @@
#include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h"
#endif
/* end of file */

View file

@ -18,6 +18,10 @@
#include "sound_driver_al.h"
#include "buffer_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
namespace NLSOUND

View file

@ -19,6 +19,10 @@
#include "effect_al.h"
#include "sound_driver_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
// using namespace NLMISC;

View file

@ -18,6 +18,10 @@
#include "listener_al.h"
#include "sound_driver_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
namespace NLSOUND {

View file

@ -22,6 +22,10 @@
#include "ext_al.h"
#include "effect_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -22,6 +22,10 @@
#include "source_al.h"
#include "ext_al.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
// #define NLSOUND_DEBUG_GAIN
using namespace std;

View file

@ -20,6 +20,10 @@
#include "buffer_xaudio2.h"
#include "adpcm_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
// using namespace NLMISC;

View file

@ -20,6 +20,10 @@
#include "buffer_xaudio2.h"
#include "sound_driver_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -21,6 +21,10 @@
#include "listener_xaudio2.h"
#include "effect_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -20,6 +20,10 @@
#include "sound_driver_xaudio2.h"
#include "listener_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -22,6 +22,10 @@
#include "effect_xaudio2.h"
#include "sound_driver_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -26,6 +26,10 @@
#include "effect_xaudio2.h"
#include "source_xaudio2.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -135,7 +135,6 @@ IF(WITH_RYZOM_CLIENT)
ENDIF()
ENDIF()
IF(WITH_RYZOM_STEAM AND STEAM_RUNTIME)
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp -p ${STEAM_RUNTIME} ${RYZOM_CONTENTS_DIR}/MacOS)
@ -178,7 +177,6 @@ IF(WITH_RYZOM_CLIENT)
${LUA_LIBRARIES}
${LUABIND_LIBRARIES}
${CURL_LIBRARIES}
${OPENSSL_LIBRARIES}
)
IF(NOT APPLE AND NOT WIN32)

View file

@ -22,6 +22,10 @@
#include "events_listener.h"
#include "interface_v3/interface_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;
using namespace NLMISC;

View file

@ -28,6 +28,9 @@
#include "actions_client.h"
#include "interface_v3/input_handler_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
///////////
// USING //

View file

@ -35,6 +35,9 @@
#include "client_cfg.h"
#include "entity_animation_manager.h" // \todo GUIGUI : added to recompile animations at loading (to do better ?).
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
///////////
// USING //

View file

@ -27,6 +27,10 @@
#include "nel/3d/u_scene.h"
#include "client_sheets/animation_fx_set_sheet.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern NL3D::UScene *Scene;

View file

@ -23,6 +23,10 @@
//
#include "nel/3d/u_scene.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern NL3D::UScene *Scene;
// *********************************************************************

View file

@ -20,4 +20,8 @@
#include "animation_fx_misc.h"
#include "animation_fx_id_array.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
CAnimationFXIDArray AnimFXMisc;

View file

@ -27,6 +27,9 @@
// 3d
#include "nel/3d/u_track.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
///////////
// USING //

View file

@ -33,6 +33,10 @@
#include "nel/georges/u_form_elm.h"
#include "nel/georges/u_form_loader.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
///////////
// USING //
///////////

View file

@ -30,6 +30,10 @@
// Georges
#include "nel/georges/u_form_elm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
///////////
// USING //
///////////

View file

@ -21,6 +21,10 @@
#include <CoreFoundation/CoreFoundation.h>
#endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
std::string getAppBundlePath()
{
static std::string s_cachedPathToBundle;

View file

@ -27,6 +27,10 @@
#include "time_client.h"
#include "fx_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern NL3D::UScene *Scene;

View file

@ -29,6 +29,9 @@
//
#include <utility>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
H_AUTO_DECL(RZ_AttackList)

View file

@ -33,6 +33,9 @@
#include <string>
#include <fstream>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
///////////
// USING //

View file

@ -19,6 +19,10 @@
#include "stdpch.h"
#include "behaviour_context.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
CBehaviourContext::CBehaviourContext()
{
}

View file

@ -31,6 +31,10 @@
#include "nel/misc/win_thread.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace BGDownloader;
using namespace NLMISC;

View file

@ -17,6 +17,10 @@
#include "stdpch.h"
#include "browse_faq.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
void browseFAQ(NLMISC::CConfigFile &cf)

View file

@ -22,6 +22,10 @@
#include "global.h"
#include "misc.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace NL3D;

View file

@ -111,6 +111,9 @@
#include "game_share/range_weapon_type.h"
//
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
////////////
// DEFINE //
@ -137,10 +140,6 @@ using namespace std;
using namespace MBEHAV;
using namespace CLFECOMMON;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
////////////
// EXTERN //
////////////

View file

@ -107,6 +107,9 @@
// to desactive some commands
//
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
////////////////

View file

@ -935,7 +935,6 @@ void CContinent::unselect()
// Remove the instances (shapes).
EntitiesMngr.removeInstances();
// release collision primitives
if (IGCallbacks)
{

View file

@ -26,6 +26,10 @@ using namespace NLMISC;
using namespace NLNET;
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
#define _Curl (CURL *)_CurlStruct
@ -113,6 +117,25 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm
if (itmp && itmp->x509)
{
X509_NAME *subject = X509_get_subject_name(itmp->x509);
std::string name;
unsigned char *tmp = NULL;
// construct a multiline string with name
for (int i = 0, ilen = X509_NAME_entry_count(subject); i < ilen; ++i)
{
X509_NAME_ENTRY *e = X509_NAME_get_entry(subject, i);
ASN1_STRING *d = X509_NAME_ENTRY_get_data(e);
if (ASN1_STRING_to_UTF8(&tmp, d) > 0)
{
name += NLMISC::toString("%s\n", tmp);
OPENSSL_free(tmp);
}
}
// add our certificate to this store
if (X509_STORE_add_cert(store, itmp->x509) == 0)
{
@ -122,13 +145,13 @@ static CURLcode sslctx_function(CURL * /* curl */, void *sslctx, void * /* parm
if (ERR_GET_LIB(errCode) != ERR_LIB_X509 || ERR_GET_REASON(errCode) != X509_R_CERT_ALREADY_IN_HASH_TABLE)
{
ERR_error_string_n(errCode, errorBuffer, 1024);
nlwarning("Error adding certificate %s: %s", itmp->x509->name, errorBuffer);
nlwarning("Error adding certificate %s: %s", name.c_str(), errorBuffer);
res = CURLE_SSL_CACERT;
}
}
else
{
nlinfo("Added certificate %s", itmp->x509->name);
nlinfo("Added certificate %s", name.c_str());
}
}
}

View file

@ -21,6 +21,10 @@
//
#include "nel/misc/i18n.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;

View file

@ -17,6 +17,9 @@
#include "stdpch.h"
#include "config_var.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2

View file

@ -23,6 +23,10 @@
#include "nel/gui/lua_ihm.h"
#include "nel/gui/interface_element.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2
{

View file

@ -20,6 +20,10 @@
#include "../interface_v3/lua_ihm_ryzom.h"
#include "editor.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2
{

View file

@ -33,6 +33,10 @@
//
#include "r2_config.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
extern uint SkipFrame;

View file

@ -23,6 +23,9 @@
#include "../interface_v3/interface_manager.h"
#include "nel/gui/view_renderer.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;

View file

@ -58,6 +58,10 @@
//
#include "../sheet_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace NL3D;

View file

@ -38,6 +38,10 @@
#include "../time_client.h"
//
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
class CGroupMap;
using namespace R2;

View file

@ -22,6 +22,9 @@
#include "../global.h"
//
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace NL3D;

View file

@ -33,6 +33,9 @@
#include "nel/3d/u_visual_collision_manager.h"
#include "nel/3d/u_visual_collision_entity.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;

View file

@ -21,6 +21,10 @@
#include "../editor.h"
#include "nel/gui/lua_ihm.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2
{

View file

@ -68,6 +68,9 @@
#include <zlib.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace std;

View file

@ -58,6 +58,9 @@ using namespace NLGUI;
using namespace NLMISC;
using namespace R2;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
std::map<lua_State*, CComLuaModule*> CComLuaModule::_Instance;

View file

@ -45,6 +45,9 @@
#include <assert.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLNET;
using namespace NLMISC;

View file

@ -21,6 +21,10 @@
#include <assert.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace R2;
namespace R2

View file

@ -21,6 +21,11 @@
#include "game_share/object.h"
#include <assert.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace R2;

View file

@ -47,7 +47,6 @@
#include "editor.h"
//
#include "nel/gui/lua_helper.h"
using namespace NLGUI;
#include "nel/gui/group_tree.h"
#include "../interface_v3/interface_manager.h"
#include "../contextual_cursor.h"
@ -115,11 +114,14 @@ using namespace NLGUI;
#include "../far_tp.h"
#include "nel/gui/lua_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace NLNET;
using namespace NL3D;
using namespace NLGUI;
extern CEventsListener EventsListener;
extern CLog g_log;
@ -1628,8 +1630,17 @@ int CEditor::luaEnumInstances(CLuaState &ls)
mt.setValue("__gc", CLuaObject(ls));
//
void *newIter = ls.newUserData(sizeof(CInstanceEnumerator));
#ifdef new
#undef new
#endif
CInstanceEnumerator *ie = new (newIter) CInstanceEnumerator;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
ie->InstMap = &getEditor()._InstancesByDispName[classIndex];
ie->Current = ie->InstMap->begin();
mt.push();

View file

@ -21,6 +21,10 @@
//
#include "nel/misc/vector.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
namespace R2

View file

@ -20,6 +20,10 @@
#include "../user_entity.h"
#include "../time_client.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
namespace R2

View file

@ -30,6 +30,9 @@
//
#include "displayer_visual_entity.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;

View file

@ -33,6 +33,10 @@
//
#include "nel/3d/texture_file.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
extern CContinentManager ContinentMngr;
using namespace NL3D;

View file

@ -18,6 +18,9 @@
#include "lua_event_forwarder.h"
#include "nel/gui/lua_object.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2
{

View file

@ -21,6 +21,9 @@
#include "../global.h"
#include "../misc.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace NL3D;

View file

@ -27,6 +27,10 @@
#include "../sheet_manager.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NLMISC;
using namespace NL3D;
using namespace std;

View file

@ -21,6 +21,10 @@
#include "nel/gui/lua_ihm.h"
#include "../interface_v3/lua_ihm_ryzom.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2
{
@ -319,7 +323,17 @@ void CObjectTableClient::pushOnLuaStack(CLuaState &state, CLuaObject &metatable)
nlassert(metatable.isValid());
// return a new refptr on the sub table
void *block = state.newUserData(sizeof(TRefPtrConst));
#ifdef new
#undef new
#endif
new (block) CObjectTable::TRefPtrConst(this); // create in place
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
metatable.push();
state.setMetaTable(-2);
_Ref.pop(state);

View file

@ -18,6 +18,9 @@
#include "palette_node.h"
#include "editor.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace R2

View file

@ -29,6 +29,9 @@
#include "nel/gui/view_renderer.h"
#include "../interface_v3/group_map.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
using namespace NL3D;
using namespace NLMISC;

Some files were not shown because too many files have changed in this diff Show more