Merge with default

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 11 years ago
commit 58028ce6a5

@ -2,47 +2,86 @@
# Find the Windows includes
#
# WINSDK_INCLUDE_DIR - where to find Windows.h
# WINSDK_INCLUDE_DIRS - where to find all Windows headers
# WINSDK_LIBRARY_DIR - where to find libraries
# WINSDK_FOUND - True if Windows SDK found.
IF(WINSDK_INCLUDE_DIR)
# Already in cache, be silent
SET(WINSDK_FIND_QUIETLY TRUE)
SET(WindowsSDK_FIND_QUIETLY TRUE)
ENDIF(WINSDK_INCLUDE_DIR)
# TODO: add the possibility to use a specific Windows SDK
IF(MSVC11)
GET_FILENAME_COMPONENT(WINSDK8_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE)
GET_FILENAME_COMPONENT(WINSDK8_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;ProductVersion]" NAME)
IF(WINSDK8_DIR)
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${WINSDK8_VERSION} in ${WINSDK8_DIR}")
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
IF(TARGET_ARM)
SET(WINSDK8_SUFFIX "arm")
ELSEIF(TARGET_X64)
SET(WINSDK8_SUFFIX "x64")
ELSEIF(TARGET_X86)
SET(WINSDK8_SUFFIX "x86")
ENDIF(TARGET_ARM)
ENDIF(WINSDK8_DIR)
ENDIF(MSVC11)
GET_FILENAME_COMPONENT(WINSDK71_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;InstallationFolder]" ABSOLUTE CACHE)
GET_FILENAME_COMPONENT(WINSDK71_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1;ProductVersion]" NAME)
IF(WINSDK71_DIR)
IF(NOT WINSDK_FIND_QUIETLY)
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${WINSDK71_VERSION} in ${WINSDK71_DIR}")
ENDIF(NOT WINSDK_FIND_QUIETLY)
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDK71_DIR)
GET_FILENAME_COMPONENT(WINSDKCURRENT_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" ABSOLUTE CACHE)
GET_FILENAME_COMPONENT(WINSDKCURRENT_VERSION "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentVersion]" NAME)
IF(WINSDKCURRENT_DIR)
IF(NOT WINSDK_FIND_QUIETLY)
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${WINSDKCURRENT_VERSION} in ${WINSDKCURRENT_DIR}")
ENDIF(NOT WINSDK_FIND_QUIETLY)
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDKCURRENT_DIR)
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
PATHS
HINTS
${WINSDK8_DIR}/Include/um
${WINSDK71_DIR}/Include
${WINSDKCURRENT_DIR}/Include
)
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS
${WINSDK8_DIR}/Include/shared
${WINSDK71_DIR}/Include
${WINSDKCURRENT_DIR}/Include
)
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS
${WINSDK8_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
${WINSDK71_DIR}/Lib
${WINSDKCURRENT_DIR}/Lib
)
FIND_PROGRAM(WINSDK_SIGNTOOL signtool
PATHS
HINTS
${WINSDK8_DIR}/Bin/x86
${WINSDK71_DIR}/Bin
${WINSDKCURRENT_DIR}/Bin
)
IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_FOUND TRUE)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIR} ${WINSDK_SHARED_INCLUDE_DIR})
ELSE(WINSDK_INCLUDE_DIR)
IF(NOT WINSDK_FIND_QUIETLY)
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Windows SDK!")
ENDIF(NOT WINSDK_FIND_QUIETLY)
ENDIF(NOT WindowsSDK_FIND_QUIETLY)
ENDIF(WINSDK_INCLUDE_DIR)

@ -9,250 +9,384 @@
# ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp
IF(MSVC)
SET(PCHSupport_FOUND TRUE)
SET(_PCH_include_prefix "/I")
SET(PCHSupport_FOUND TRUE)
SET(_PCH_include_prefix "/I")
ELSE(MSVC)
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
IF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ELSE(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
IF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "3\\.4\\.[0-9]")
ENDIF(gcc_compiler_version MATCHES "4\\.[0-9]\\.[0-9]")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
# TODO: make tests for other compilers than GCC
SET(PCHSupport_FOUND TRUE)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(_PCH_include_prefix "-I")
IF(CMAKE_COMPILER_IS_GNUCXX)
EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE gcc_compiler_version)
IF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?")
SET(PCHSupport_FOUND FALSE)
ELSEIF(gcc_compiler_version MATCHES "^4\\.[0-9]+(\\.[0-9]+)?")
SET(PCHSupport_FOUND TRUE)
ENDIF(gcc_compiler_version MATCHES "^4\\.1(\\.[0-9]+)?")
ELSE(CMAKE_COMPILER_IS_GNUCXX)
# TODO: make tests for other compilers than GCC
SET(PCHSupport_FOUND TRUE)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(_PCH_include_prefix "-I")
ENDIF(MSVC)
MACRO(_PCH_GET_COMPILE_FLAGS _out_compile_flags)
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
SET(_FLAGS ${${_flags_var_name}} )
IF(NOT MSVC)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
LIST(APPEND _FLAGS "-fPIC")
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
ENDIF(NOT MSVC)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES )
FOREACH(item ${DIRINC})
LIST(APPEND _FLAGS " ${_PCH_include_prefix}\"${item}\"")
ENDFOREACH(item)
# Required for CMake 2.6
SET(GLOBAL_DEFINITIONS "")
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS -D${item})
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
LIST(APPEND _FLAGS ${GLOBAL_DEFINITIONS})
LIST(APPEND _FLAGS ${_directory_flags})
LIST(APPEND _FLAGS ${_directory_definitions})
LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
# Format definitions
SEPARATE_ARGUMENTS(_FLAGS)
IF(CLANG)
SET(_IGNORE_NEXT OFF)
FOREACH(item ${_FLAGS})
IF(_IGNORE_NEXT)
SET(_IGNORE_NEXT OFF)
ELSE(_IGNORE_NEXT)
IF(item MATCHES "^-Xarch")
SET(_IGNORE_NEXT ON)
ELSEIF(item MATCHES "^-arch")
SET(_IGNORE_NEXT ON)
ELSE(item MATCHES "^-Xarch")
LIST(APPEND ${_out_compile_flags} ${item})
ENDIF(item MATCHES "^-Xarch")
ENDIF(_IGNORE_NEXT)
ENDFOREACH(item)
ELSE(CLANG)
SET(${_out_compile_flags} ${_FLAGS})
ENDIF(CLANG)
ENDMACRO(_PCH_GET_COMPILE_FLAGS)
MACRO(_PCH_GET_PDB_FILENAME out_filename _target)
# determine output directory based on target type
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
IF(${_targetType} STREQUAL EXECUTABLE)
SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY)
SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
ELSE(${_targetType} STREQUAL EXECUTABLE)
SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
ENDIF(${_targetType} STREQUAL EXECUTABLE)
# determine target postfix
STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name)
GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name})
IF(${_targetPostfix} MATCHES NOTFOUND)
SET(_targetPostfix "")
ENDIF(${_targetPostfix} MATCHES NOTFOUND)
SET(${out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
ENDMACRO(_PCH_GET_PDB_FILENAME)
MACRO(_PCH_GET_COMPILE_COMMAND out_command _input _inputcpp _output)
IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument
STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
ELSE(CMAKE_CXX_COMPILER_ARG1)
SET(pchsupport_compiler_cxx_arg1 "")
ENDIF(CMAKE_CXX_COMPILER_ARG1)
IF(MSVC)
_PCH_GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp\"${_output}\" ${_inputcpp} /c /Fd\"${PDB_FILE}\")
ELSE(MSVC)
SET(HEADER_FORMAT "c++-header")
IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
ENDIF(APPLE)
SET(${out_command} ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} -x ${HEADER_FORMAT} -o ${_output} -c ${_input})
ENDIF(MSVC)
ENDMACRO(_PCH_GET_COMPILE_COMMAND)
MACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input _output)
IF(MSVC)
GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.pch")
ELSE(MSVC)
GET_FILENAME_COMPONENT(_name ${_input} NAME)
SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
ENDIF(MSVC)
ENDMACRO(GET_PRECOMPILED_HEADER_OUTPUT _targetName _input)
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName _input _pch_output_to_use )
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
IF(MSVC)
SET(_target_cflags "${oldProps} /Yu\"${_input}\" /FI\"${_input}\" /Fp\"${_pch_output_to_use}\"")
ELSE(MSVC)
# to do: test whether compiler flags match between target _targetName
# and _pch_output_to_use
FILE(TO_NATIVE_PATH ${_pch_output_to_use} _native_pch_path)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS}-include ${_input} -Winvalid-pch")
ENDIF(MSVC)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags})
IF(oldProps)
SET_TARGET_PROPERTIES(${_targetName}_pch_dephelp PROPERTIES COMPILE_FLAGS ${oldProps})
ENDIF(oldProps)
ADD_CUSTOM_TARGET(pch_Generate_${_targetName} DEPENDS ${_pch_output_to_use})
ADD_DEPENDENCIES(${_targetName} pch_Generate_${_targetName})
# Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs
MACRO(PCH_SET_COMPILE_FLAGS _target)
SET(PCH_FLAGS)
SET(PCH_ARCHS)
SET(FLAGS)
LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD)
LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}")
IF(NOT MSVC)
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
LIST(APPEND _FLAGS " -fPIC")
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
ENDIF(NOT MSVC)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES)
FOREACH(item ${DIRINC})
LIST(APPEND _FLAGS " ${_PCH_include_prefix}\"${item}\"")
ENDFOREACH(item)
# Required for CMake 2.6
SET(GLOBAL_DEFINITIONS)
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD})
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH(item)
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps)
LIST(APPEND _FLAGS " ${oldProps}")
ENDIF(oldProps)
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild)
LIST(APPEND _FLAGS " ${oldPropsBuild}")
ENDIF(oldPropsBuild)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
LIST(APPEND _FLAGS " ${GLOBAL_DEFINITIONS}")
LIST(APPEND _FLAGS " ${_directory_flags}")
LIST(APPEND _FLAGS " ${_directory_definitions}")
STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS})
# Format definitions
SEPARATE_ARGUMENTS(_FLAGS)
IF(CLANG)
# Determining all architectures and get common flags
SET(_ARCH_NEXT)
SET(_XARCH_NEXT)
FOREACH(item ${_FLAGS})
IF(_ARCH_NEXT)
LIST(FIND PCH_ARCHS ${item} ITEM_FOUND)
IF(ITEM_FOUND EQUAL -1)
LIST(APPEND PCH_ARCHS ${item})
STRING(TOUPPER "${item}" _UPPER_ARCH)
SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item})
ENDIF(ITEM_FOUND EQUAL -1)
SET(_ARCH_NEXT OFF)
ELSEIF(_XARCH_NEXT)
SET(_XARCH_NEXT OFF)
ELSE(_ARCH_NEXT)
IF(item MATCHES "^-arch")
SET(_ARCH_NEXT ON)
ELSEIF(item MATCHES "^-Xarch_")
STRING(REGEX REPLACE "-Xarch_([a-z0-9_]+)" "\\1" item ${item})
LIST(FIND PCH_ARCHS ${item} ITEM_FOUND)
IF(ITEM_FOUND EQUAL -1)
LIST(APPEND PCH_ARCHS ${item})
STRING(TOUPPER "${item}" _UPPER_ARCH)
SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item})
ENDIF(ITEM_FOUND EQUAL -1)
SET(_XARCH_NEXT ON)
ELSE(item MATCHES "^-arch")
LIST(APPEND PCH_FLAGS ${item})
ENDIF(item MATCHES "^-arch")
ENDIF(_ARCH_NEXT)
ENDFOREACH(item)
# Get architcture specific flags
SET(_XARCH_NEXT)
FOREACH(item ${_FLAGS})
IF(_XARCH_NEXT)
STRING(TOUPPER "${_XARCH_NEXT}" _UPPER_XARCH)
LIST(APPEND PCH_ARCH_${_UPPER_XARCH}_FLAGS ${item})
SET(_XARCH_NEXT OFF)
ELSE(_XARCH_NEXT)
IF(item MATCHES "^-Xarch_")
STRING(SUBSTRING "${item}" 7 -1 _XARCH_NEXT)
ENDIF(item MATCHES "^-Xarch_")
ENDIF(_XARCH_NEXT)
ENDFOREACH(item)
# Remove duplicated architectures
IF(_ARCHS AND PCH_ARCHS)
LIST(REMOVE_DUPLICATES PCH_ARCHS)
ENDIF(_ARCHS AND PCH_ARCHS)
ELSE(CLANG)
SET(PCH_FLAGS ${_FLAGS})
ENDIF(CLANG)
IF(PCH_FLAGS)
LIST(REMOVE_DUPLICATES PCH_FLAGS)
ENDIF(PCH_FLAGS)
ENDMACRO(PCH_SET_COMPILE_FLAGS)
MACRO(GET_PDB_FILENAME _out_filename _target)
# determine output directory based on target type
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
IF(${_targetType} STREQUAL EXECUTABLE)
SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY)
SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
ELSE(${_targetType} STREQUAL EXECUTABLE)
SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
ENDIF(${_targetType} STREQUAL EXECUTABLE)
# determine target postfix
STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name)
GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name})
IF(${_targetPostfix} MATCHES NOTFOUND)
SET(_targetPostfix "")
ENDIF(${_targetPostfix} MATCHES NOTFOUND)
SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
ENDMACRO(GET_PDB_FILENAME)
MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument
STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
ELSE(CMAKE_CXX_COMPILER_ARG1)
SET(pchsupport_compiler_cxx_arg1 "")
ENDIF(CMAKE_CXX_COMPILER_ARG1)
IF(MSVC)
GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj")
ELSE(MSVC)
SET(HEADER_FORMAT "c++-header")
SET(_FLAGS "")
IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch)
ENDIF(APPLE)
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF(MSVC)
ENDMACRO(PCH_SET_COMPILE_COMMAND)
MACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT _targetName _input _arch _language)
SET(_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${_targetName}_pch")
IF(MSVC)
FILE(MAKE_DIRECTORY ${_OUTPUT_DIR})
GET_FILENAME_COMPONENT(_name ${_input} NAME_WE)
SET(PCH_INPUT ${_input})
SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.pch")
ELSE(MSVC)
IF(NOT "${_arch}" STREQUAL "")
SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_arch}")
ENDIF(NOT "${_arch}" STREQUAL "")
IF(NOT "${_language}" STREQUAL "")
SET(_OUTPUT_DIR "${_OUTPUT_DIR}_${_language}")
ENDIF(NOT "${_language}" STREQUAL "")
GET_FILENAME_COMPONENT(_name ${_input} NAME)
# Copy .h to output dir
SET(PCH_INPUT "${_OUTPUT_DIR}/${_name}")
ADD_CUSTOM_COMMAND(OUTPUT ${PCH_INPUT}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${_input} ${PCH_INPUT}
DEPENDS ${_input}
COMMENT "[${_targetName}] Update precompiled header - done"
)
IF(CLANG)
SET(PCH_EXT "pth")
ELSE(CLANG)
SET(PCH_EXT "gch")
ENDIF(CLANG)
# For GCC and Clang, PCH needs to be in the same directory as .h
SET(PCH_OUTPUT "${_OUTPUT_DIR}/${_name}.${PCH_EXT}")
ENDIF(MSVC)
ENDMACRO(PCH_SET_PRECOMPILED_HEADER_OUTPUT)
# Add common flags
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
IF(MSVC)
SET(_target_cflags "${oldProps} /Yu\"${PCH_INPUT}\" /FI\"${PCH_INPUT}\" /Fp\"${PCH_OUTPUT}\"")
ELSE(MSVC)
# for use with distcc and gcc >4.0.1 if preprocessed files are accessible
# on all remote machines set
# PCH_ADDITIONAL_COMPILER_FLAGS to -fpch-preprocess
SET(PCH_ADDITIONAL_COMPILER_FLAGS)
LIST(LENGTH PCH_ARCHS PCH_ARCHS_COUNT)
# If no arch is specified, create common flags
IF(PCH_ARCHS_COUNT LESS 2)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-include ${PCH_INPUT} ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF(PCH_ARCHS_COUNT LESS 2)
IF(APPLE)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF(APPLE)
IF(WITH_PCH_DEBUG)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-H ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF(WITH_PCH_DEBUG)
SET(_target_cflags "${oldProps} ${PCH_ADDITIONAL_COMPILER_FLAGS} -Winvalid-pch")
ENDIF(MSVC)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_target_cflags})
ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET)
MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
# Add specific flags for an arch
MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH _targetName _arch)
LIST(LENGTH PCH_ARCHS PCH_ARCHS_COUNT)
IF(PCH_ARCHS_COUNT GREATER 1)
GET_TARGET_PROPERTY(_FLAGS ${_targetName} COMPILE_FLAGS)
IF(${_FLAGS} MATCHES NOTFOUND)
SET(_FLAGS "")
ENDIF(${_FLAGS} MATCHES NOTFOUND)
SET(_FLAGS "${_FLAGS} -Xarch_${_arch} -include${PCH_INPUT}")
SET(_PCH_current_target ${_targetName})
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS ${_FLAGS})
ENDIF(PCH_ARCHS_COUNT GREATER 1)
ENDMACRO(ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH)
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"You must set CMAKE_BUILD_TYPE!"
)
ENDIF(NOT CMAKE_BUILD_TYPE)
MACRO(PCH_CREATE_TARGET _targetName _targetNamePCH)
ADD_CUSTOM_COMMAND(OUTPUT ${PCH_OUTPUT} COMMAND ${PCH_COMMAND} COMMENT "Generating ${_targetNamePCH}" DEPENDS ${PCH_INPUT})
ADD_CUSTOM_TARGET(${_targetNamePCH} DEPENDS ${PCH_INPUT} ${PCH_OUTPUT})
ADD_DEPENDENCIES(${_targetName} ${_targetNamePCH})
ENDMACRO(PCH_CREATE_TARGET _targetName _inputh _inputcpp)
GET_PRECOMPILED_HEADER_OUTPUT( ${_targetName} ${_inputh} _output)
MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
SET(_PCH_current_target ${_targetName})
IF(NOT CMAKE_BUILD_TYPE)
MESSAGE(FATAL_ERROR
"This is the ADD_PRECOMPILED_HEADER macro. "
"You must set CMAKE_BUILD_TYPE!"
)
ENDIF(NOT CMAKE_BUILD_TYPE)
GET_TARGET_PROPERTY(_targetType ${_PCH_current_target} TYPE)
PCH_SET_COMPILE_FLAGS(${_targetName})
# always build static library because it doesn't need linking
ADD_LIBRARY(${_targetName}_pch_dephelp STATIC ${_inputcpp})
IF(PCH_ARCHS)
SET(PCH_OUTPUTS)
FOREACH(_ARCH ${PCH_ARCHS})
STRING(TOUPPER "${_ARCH}" _UPPER_ARCH)
_PCH_GET_COMPILE_FLAGS(_compile_FLAGS)
PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} ${_ARCH} "")
LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT})
SET_SOURCE_FILES_PROPERTIES(${_inputh} PROPERTIES GENERATED 1)
PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}")
PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch_${_ARCH})
_PCH_GET_COMPILE_COMMAND(_command ${_inputh} ${_inputcpp} ${_output})
ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH(${_targetName} ${_ARCH})
ENDFOREACH(_ARCH)
ELSE(PCH_ARCHS)
PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} "" "")
LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT})
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND ${_command}
DEPENDS ${_inputh} ${_targetName}_pch_dephelp
)
PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}")
PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch)
ENDIF(PCH_ARCHS)
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName} ${_inputh} ${_output})
ADD_PRECOMPILED_HEADER_TO_TARGET(${_targetName})
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PCH_OUTPUTS}")
ENDMACRO(ADD_PRECOMPILED_HEADER)
# Macro to move PCH creation file to the front of files list
# or remove .cpp from library/executable to avoid warning
MACRO(FIX_PRECOMPILED_HEADER _files _pch)
# Remove .cpp creating PCH from the list
LIST(REMOVE_ITEM ${_files} ${_pch})
# Prepend .cpp creating PCH to the list
LIST(INSERT ${_files} 0 ${_pch})
# Remove .cpp creating PCH from the list
LIST(REMOVE_ITEM ${_files} ${_pch})
IF(MSVC)
# Prepend .cpp creating PCH to the list
LIST(INSERT ${_files} 0 ${_pch})
ENDIF(MSVC)
ENDMACRO(FIX_PRECOMPILED_HEADER)
MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
SET(PCH_METHOD 0)
# 0 => creating a new target for PCH, works for all makefiles
# 1 => setting PCH for VC++ project, works for VC++ projects
# 2 => setting PCH for XCode project, works for XCode projects
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG)
# To fix a bug with MFC
# Don't forget to use FIX_PRECOMPILED_HEADER before creating the target
# SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
SET(PCH_METHOD 2)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
IF(PCH_METHOD EQUAL 1)
# Auto include the precompile (useful for moc processing, since the use of
# precompiled is specified at the target level
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}")
#also inlude ${oldProps} to have the same compile options
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"")
ELSEIF(PCH_METHOD EQUAL 2)
# For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
# When buiding out of the tree, precompiled may not be located
# Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
ELSE(PCH_METHOD EQUAL 1)
#Fallback to the "old" precompiled suppport
ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
ENDIF(PCH_METHOD EQUAL 1)
IF(NOT PCHSupport_FOUND)
MESSAGE(STATUS "PCH disabled because compiler doesn't support them")
RETURN()
ENDIF(NOT PCHSupport_FOUND)
# 0 => creating a new target for PCH, works for all makefiles
# 1 => setting PCH for VC++ project, works for VC++ projects
# 2 => setting PCH for XCode project, works for XCode projects
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "NMake Makefiles" AND MFC_FOUND AND CMAKE_MFC_FLAG)
# To fix a bug with MFC
# Don't forget to use FIX_PRECOMPILED_HEADER before creating the target
# SET(PCH_METHOD 1)
ELSEIF(CMAKE_GENERATOR MATCHES "Xcode")
SET(PCH_METHOD 2)
ELSE(CMAKE_GENERATOR MATCHES "Visual Studio")
SET(PCH_METHOD 0)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")
IF(PCH_METHOD EQUAL 1)
# Auto include the precompile (useful for moc processing, since the use of
# precompiled is specified at the target level
# and I don't want to specifiy /F- for each moc/res/ui generated files (using Qt)
GET_TARGET_PROPERTY(oldProps ${_targetName} COMPILE_FLAGS)
IF(${oldProps} MATCHES NOTFOUND)
SET(oldProps "")
ENDIF(${oldProps} MATCHES NOTFOUND)
SET(newProperties "${oldProps} /Yu\"${_inputh}\" /FI\"${_inputh}\"")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "${newProperties}")
#also inlude ${oldProps} to have the same compile options
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES COMPILE_FLAGS "${oldProps} /Yc\"${_inputh}\"")
ELSEIF(PCH_METHOD EQUAL 2)
# For Xcode, cmake needs my patch to process
# GCC_PREFIX_HEADER and GCC_PRECOMPILE_PREFIX_HEADER as target properties
# When buiding out of the tree, precompiled may not be located
# Use full path instead.
GET_FILENAME_COMPONENT(fullPath ${_inputh} ABSOLUTE)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${fullPath}")
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
ELSE(PCH_METHOD EQUAL 1)
#Fallback to the "old" precompiled suppport
ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
ENDIF(PCH_METHOD EQUAL 1)
IF(TARGET ${_targetName}_static)
ADD_NATIVE_PRECOMPILED_HEADER(${_targetName}_static ${_inputh} ${_inputcpp})
ENDIF(TARGET ${_targetName}_static)
ENDMACRO(ADD_NATIVE_PRECOMPILED_HEADER)

@ -50,14 +50,11 @@ MACRO(NL_GEN_REVISION_H)
IF(TOOL_FOUND)
# a custom target that is always built
ADD_CUSTOM_TARGET(revision ALL)
# creates revision.h using cmake script
ADD_CUSTOM_COMMAND(TARGET revision
PRE_BUILD
ADD_CUSTOM_TARGET(revision ALL
COMMAND ${CMAKE_COMMAND}
-DSOURCE_DIR=${CMAKE_SOURCE_DIR}
-DROOT_DIR=${CMAKE_SOURCE_DIR}/..
-DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/CMakeModules
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GetRevision.cmake)
# revision.h is a generated file
@ -102,6 +99,11 @@ ENDMACRO(NL_TARGET_DRIVER)
# Argument:
###
MACRO(NL_DEFAULT_PROPS name label)
IF(HAVE_REVISION_H)
# explicitly say that the target depends on revision.h
ADD_DEPENDENCIES(${name} revision)
ENDIF(HAVE_REVISION_H)
# Note: This is just a workaround for a CMake bug generating VS10 files with a colon in the project name.
# CMake Bug ID: http://www.cmake.org/Bug/view.php?id=11819
STRING(REGEX REPLACE "\\:" " -" proj_label ${label})
@ -410,7 +412,7 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CMAKE_GENERATOR MATCHES "Xcode")
# If target and host CPU are the same
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
# x86-compatible CPU
IF(HOST_CPU MATCHES "x86")
IF(NOT CMAKE_SIZEOF_VOID_P)
@ -431,9 +433,9 @@ MACRO(NL_SETUP_BUILD)
MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}")
ENDIF(HOST_CPU MATCHES "x86")
# TODO: add checks for PPC
ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}")
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
# Use values from environment variables
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}")
@ -454,6 +456,7 @@ MACRO(NL_SETUP_BUILD)
IF(NOT CMAKE_OSX_ARCHITECTURES)
IF(TARGET_CPU STREQUAL "x86_64")
SET(TARGET_X64 1)
SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "armv7s")
@ -470,7 +473,37 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_ARMV5 1)
ELSEIF(TARGET_CPU STREQUAL "arm")
SET(TARGET_ARM 1)
ELSEIF(TARGET_CPU STREQUAL "mips")
SET(TARGET_MIPS 1)
ENDIF(TARGET_CPU STREQUAL "x86_64")
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-HAVE_ARMV6")
ENDIF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-DHAVE_ARM")
ENDIF(TARGET_ARM)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-DHAVE_X86")
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-DHAVE_MIPS")
ENDIF(TARGET_MIPS)
ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
# Fix library paths suffixes for Debian MultiArch
@ -478,10 +511,9 @@ MACRO(NL_SETUP_BUILD)
SET(CMAKE_LIBRARY_PATH /lib/${LIBRARY_ARCHITECTURE} /usr/lib/${LIBRARY_ARCHITECTURE} ${CMAKE_LIBRARY_PATH})
IF(TARGET_X64)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
ENDIF(TARGET_X64)
IF(TARGET_X86)
ELSEIF(TARGET_X86)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
ENDIF(TARGET_X86)
ENDIF(TARGET_X64)
ENDIF(LIBRARY_ARCHITECTURE)
IF(APPLE AND NOT IOS)
@ -489,32 +521,22 @@ MACRO(NL_SETUP_BUILD)
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
ENDIF(APPLE AND NOT IOS)
IF(TARGET_ARM)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-HAVE_ARMV6")
ENDIF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-DHAVE_ARM")
ENDIF(TARGET_ARM)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-DHAVE_X86")
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
ENDIF(TARGET_X64)
IF(WITH_LOGGING)
ADD_PLATFORM_FLAGS("-DENABLE_LOGS")
ENDIF(WITH_LOGGING)
IF(MSVC)
IF(MSVC10)
IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
SET(MSVC11 ON)
ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
IF(MSVC11)
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2010, 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}")
ELSEIF(MSVC10)
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
@ -532,9 +554,9 @@ MACRO(NL_SETUP_BUILD)
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}")
ELSE(MSVC10)
ELSE(MSVC11)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF(MSVC10)
ENDIF(MSVC11)
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250")
@ -577,13 +599,10 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CLANG)
ENDIF(WIN32)
IF(TARGET_ARM)
ADD_PLATFORM_FLAGS("-mthumb")
ENDIF(TARGET_ARM)
IF(APPLE)
IF(IOS)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.7" CACHE PATH "" FORCE)
# Disable CMAKE_OSX_DEPLOYMENT_TARGET for iOS
SET(CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE PATH "" FORCE)
ELSE(IOS)
IF(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE PATH "" FORCE)
@ -609,6 +628,11 @@ MACRO(NL_SETUP_BUILD)
SET(_ARCHS "${_ARCHS} x86_64")
SET(TARGET_X64 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "armv7s")
SET(_ARCHS "${_ARCHS} armv7s")
SET(TARGET_ARMV7S 1)
SET(TARGET_ARM 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "armv7")
SET(_ARCHS "${_ARCHS} armv7")
SET(TARGET_ARMV7 1)
@ -619,16 +643,51 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_ARMV6 1)
SET(TARGET_ARM 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSEIF(_ARCH STREQUAL "mips")
SET(_ARCHS "${_ARCHS} mips")
SET(TARGET_MIPS 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSE(_ARCH STREQUAL "i386")
SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})")
ENDIF(_ARCH STREQUAL "i386")
ENDFOREACH(_ARCH)
MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}")
ELSE(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 1)
SET(TARGETS_COUNT 0)
ENDIF(CMAKE_OSX_ARCHITECTURES)
IF(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6")
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5")
ENDIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM")
ENDIF(TARGET_ARM)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86")
ELSEIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86")
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS")
ENDIF(TARGET_MIPS)
ELSEIF(TARGETS_COUNT EQUAL 0)
# Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s")
@ -645,15 +704,19 @@ MACRO(NL_SETUP_BUILD)
IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5")
ENDIF(TARGET_ARMV5)
ENDIF(TARGET_ARM)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386")
ENDIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-mthumb")
ENDIF(TARGET_ARM)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64")
ELSEIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386")
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-arch mips")
ENDIF(TARGET_MIPS)
ELSE(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6")
@ -664,15 +727,21 @@ MACRO(NL_SETUP_BUILD)
ENDIF(TARGET_ARMV7)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386 -Xarch_i386 -DHAVE_X86")
ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86")
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64 -Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS")
ENDIF(TARGET_MIPS)
ENDIF(TARGETS_COUNT EQUAL 1)
IF(IOS)
SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE)
IF(IOS_VERSION)
PARSE_VERSION_STRING(${IOS_VERSION} IOS_VERSION_MAJOR IOS_VERSION_MINOR IOS_VERSION_PATCH)
CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER)
@ -681,20 +750,44 @@ MACRO(NL_SETUP_BUILD)
ENDIF(IOS_VERSION)
IF(CMAKE_IOS_SYSROOT)
ADD_PLATFORM_FLAGS("-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-iphoneos_version_min,${IOS_VERSION}")
IF(TARGET_ARMV7S)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv7s ")
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv7 ")
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv6 ")
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF(TARGET_ARMV6)
ENDIF(CMAKE_IOS_SYSROOT)
IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
IF(TARGETS_COUNT EQUAL 1)
ADD_PLATFORM_FLAGS("-arch i386")
ELSE(TARGETS_COUNT EQUAL 1)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_i386 ")
ENDIF(TARGETS_COUNT EQUAL 1)
ENDIF(TARGETS_COUNT GREATER 1)
# Always force -mmacosx-version-min to override environement variable
ADD_PLATFORM_FLAGS("${XARCH}-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
ELSE(IOS)
@ -746,6 +839,46 @@ MACRO(NL_SETUP_BUILD)
ENDIF(CLANG)
ENDIF(WITH_WARNINGS)
IF(ANDROID)
ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}")
ADD_PLATFORM_FLAGS("-ffunction-sections -funwind-tables")
ADD_PLATFORM_FLAGS("-DANDROID")
ADD_PLATFORM_FLAGS("-Wa,--noexecstack")
IF(TARGET_ARM)
ADD_PLATFORM_FLAGS("-fpic -fstack-protector")
ADD_PLATFORM_FLAGS("-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__")
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8")
ELSEIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float")
ENDIF(TARGET_ARMV7)
SET(TARGET_THUMB ON)
IF(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm")
ELSE(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
ENDIF(TARGET_THUMB)
ELSEIF(TARGET_X86)
# Optimizations for Intel Atom
ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops")
ADD_PLATFORM_FLAGS("-fstack-protector -funswitch-loops -finline-limit=300")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
ELSEIF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300")
ENDIF(TARGET_ARM)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib")
ENDIF(ANDROID)
IF(APPLE)
ADD_PLATFORM_FLAGS("-gdwarf-2")
ENDIF(APPLE)
@ -799,7 +932,7 @@ ENDMACRO(NL_SETUP_BUILD_FLAGS)
MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
IF(IS_ABSOLUTE "${${NAME_RELATIVE}}")
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(IS_ABSOLUTE "${${{NAME_RELATIVE}}")
ELSE(IS_ABSOLUTE "${${NAME_RELATIVE}}")
IF(WIN32)
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ELSE(WIN32)
@ -950,11 +1083,37 @@ MACRO(SETUP_EXTERNAL)
SET(VC_DIR $ENV{VC_DIR})
ENDIF(NOT VC_DIR)
IF(MSVC10)
IF(NOT MSVC10_REDIST_DIR)
IF(MSVC11)
IF(NOT MSVC_REDIST_DIR)
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC_REDIST_DIR)
IF(NOT VC_DIR)
IF(NOT VC_ROOT_DIR)
GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\VisualStudio\\11.0_Config;InstallDir]" ABSOLUTE)
# VC_ROOT_DIR is set to "registry" when a key is not found
IF(VC_ROOT_DIR MATCHES "registry")
GET_FILENAME_COMPONENT(VC_ROOT_DIR "[HKEY_CURRENT_USER\\Software\\Microsoft\\WDExpress\\11.0_Config\\Setup\\VC;InstallDir]" ABSOLUTE)
IF(VC_ROOT_DIR MATCHES "registry")
SET(VS110COMNTOOLS $ENV{VS110COMNTOOLS})
IF(VS110COMNTOOLS)
FILE(TO_CMAKE_PATH ${VS110COMNTOOLS} VC_ROOT_DIR)
ENDIF(VS110COMNTOOLS)
IF(NOT VC_ROOT_DIR)
MESSAGE(FATAL_ERROR "Unable to find VC++ 2012 directory!")
ENDIF(NOT VC_ROOT_DIR)
ENDIF(VC_ROOT_DIR MATCHES "registry")
ENDIF(VC_ROOT_DIR MATCHES "registry")
ENDIF(NOT VC_ROOT_DIR)
# convert IDE fullpath to VC++ path
STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR})
ENDIF(NOT VC_DIR)
ELSEIF(MSVC10)
IF(NOT MSVC_REDIST_DIR)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC10_REDIST_DIR)
SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF(NOT MSVC_REDIST_DIR)
IF(NOT VC_DIR)
IF(NOT VC_ROOT_DIR)
@ -976,7 +1135,7 @@ MACRO(SETUP_EXTERNAL)
# convert IDE fullpath to VC++ path
STRING(REGEX REPLACE "Common7/.*" "VC" VC_DIR ${VC_ROOT_DIR})
ENDIF(NOT VC_DIR)
ELSE(MSVC10)
ELSE(MSVC11)
IF(NOT VC_DIR)
IF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
# convert IDE fullpath to VC++ path
@ -986,7 +1145,7 @@ MACRO(SETUP_EXTERNAL)
STRING(REGEX REPLACE "VC/bin/.+" "VC" VC_DIR ${CMAKE_CXX_COMPILER})
ENDIF(${CMAKE_MAKE_PROGRAM} MATCHES "Common7")
ENDIF(NOT VC_DIR)
ENDIF(MSVC10)
ENDIF(MSVC11)
ELSE(WIN32)
IF(APPLE)
IF(WITH_STATIC_EXTERNAL)
@ -1011,7 +1170,7 @@ MACRO(SETUP_EXTERNAL)
FIND_PACKAGE(WindowsSDK REQUIRED)
# use VC++ and Windows SDK include paths
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIRS})
ENDIF(MSVC)
ENDIF(WITH_STLPORT)
ENDMACRO(SETUP_EXTERNAL)

@ -19,6 +19,9 @@
#include "nel/misc/types_nl.h"
// Include from libxml2
#include <libxml/parser.h>
namespace NLGEORGES
{

@ -19,6 +19,7 @@
#include "types_nl.h"
#include "tds.h"
#include "singleton.h"
namespace NLMISC {

@ -17,6 +17,7 @@
#ifndef NL_CONTIGUOUS_BLOCK_ALLOCATOR_H
#define NL_CONTIGUOUS_BLOCK_ALLOCATOR_H
#include "types_nl.h"
namespace NLMISC
{

@ -17,14 +17,14 @@
#ifndef NL_DEBUG_H
#define NL_DEBUG_H
#include <cstdio>
#include "common.h"
#include "log.h"
#include "mutex.h"
#include "mem_displayer.h"
#include "displayer.h"
#include "app_context.h"
#include <cstdio>
#include <set>
namespace NLMISC
@ -169,7 +169,7 @@ void setCrashAlreadyReported(bool state);
*\endcode
*/
#ifdef NL_NO_DEBUG
# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10)
# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# define nldebug __noop
# else
# define nldebug 0&&
@ -184,7 +184,7 @@ void setCrashAlreadyReported(bool state);
* Same as nldebug but it will be display in debug and in release mode.
*/
#ifdef NL_NO_DEBUG
# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10)
# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# define nlinfo __noop
# else
# define nlinfo 0&&
@ -212,7 +212,7 @@ void setCrashAlreadyReported(bool state);
*/
#ifdef NL_NO_DEBUG
# if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10)
# if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# define nlwarning __noop
# else
# define nlwarning 0&&

@ -17,6 +17,7 @@
#ifndef NL_FILE_H
#define NL_FILE_H
#include "types_nl.h"
#include "stream.h"

@ -17,6 +17,7 @@
#ifndef NL_FIXED_SIZE_ALLOCATOR_H
#define NL_FIXED_SIZE_ALLOCATOR_H
#include "types_nl.h"
namespace NLMISC
{

@ -17,6 +17,8 @@
#ifndef _GRID_TRAVERSAL_H
#define _GRID_TRAVERSAL_H
#include "types_nl.h"
namespace NLMISC
{

@ -19,7 +19,7 @@
#include "types_nl.h"
#include "game_device.h"
#include "common.h"
namespace NLMISC
{

@ -17,6 +17,7 @@
#ifndef RY_INTER_WINDOW_MSG_QUEUE_H
#define RY_INTER_WINDOW_MSG_QUEUE_H
#include "types_nl.h"
#ifdef NL_OS_WINDOWS

@ -586,7 +586,7 @@ extern uint32 NbMutexes;
/**
* This class ensure that the Value is accessed by only one thread. First you have to create a CSynchronized class with you type.
* This class ensure that the Value is accessed by only one thread. First you have to create a CSynchronized class with your type.
* Then, if a thread want to modify or do anything on it, you create a CAccessor in a \b sub \b scope. You can modify the value
* of the CUnfairSynchronized using the value() function \b until the end of the scope. So you have to put the smaller scope as you can.
*

@ -17,6 +17,7 @@
#ifndef NL_OBJECT_ARENA_ALLOCATOR_H
#define NL_OBJECT_ARENA_ALLOCATOR_H
#include "types_nl.h"
#include "singleton.h"
namespace NLMISC

@ -17,9 +17,10 @@
#ifndef NL_P_THREAD_H
#define NL_P_THREAD_H
#include "types_nl.h"
#ifdef NL_OS_UNIX
#include "types_nl.h"
#include "thread.h"
#include <pthread.h>

@ -19,14 +19,13 @@
#include "types_nl.h"
#include "time_nl.h"
#include "common.h"
#include "string_mapper.h"
#include <map>
#include <string>
#include <vector>
#include "common.h"
#include "string_mapper.h"
namespace NLMISC {
/// Exception throw when a find is not found in a lookup() call

@ -21,6 +21,7 @@
#include "matrix.h"
#include "stream.h"
#include "vector_2f.h"
#include <vector>

@ -18,6 +18,7 @@
#define NL_POOL_MEMORY_H
#include "types_nl.h"
#include <list>
#include <vector>

@ -20,6 +20,7 @@
#include "types_nl.h"
#include "vector.h"
#include "stream.h"
#include <cmath>
namespace NLMISC

@ -18,6 +18,8 @@
#ifndef NL_RESOURCE_PTR_INLINE_H
#define NL_RESOURCE_PTR_INLINE_H
#include "types_nl.h"
namespace NLMISC
{

@ -17,11 +17,11 @@
#ifndef NL_RGBA_H
#define NL_RGBA_H
#include <algorithm>
#include "types_nl.h"
#include "common.h"
#include <algorithm>
namespace NLMISC
{

@ -17,11 +17,12 @@
#ifndef NL_SHA1_H
#define NL_SHA1_H
#include <string>
#include "types_nl.h"
#include "common.h"
#include "stream.h"
#include <string>
struct CHashKey
{
CHashKey () { HashKeyString.resize(20); }

@ -352,7 +352,7 @@ public:
}
};
#if defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10)
#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 80
// This operator only purpose is to compare with NULL value
template <class T>

@ -18,6 +18,8 @@
#ifndef NL_SMARTPTR_INLINE_H
#define NL_SMARTPTR_INLINE_H
#include "types_nl.h"
namespace NLMISC
{

@ -19,6 +19,7 @@
#include "types_nl.h"
#include "stl_block_allocator.h"
#include <list>

@ -19,6 +19,7 @@
#include "types_nl.h"
#include "time_nl.h"
#include <deque>

@ -21,6 +21,7 @@
#include "ucstring.h"
#include "class_registry.h"
#include "common.h"
#include <utility>
#include <string>
#include <vector>

@ -17,10 +17,11 @@
#ifndef NL_STREAM_INLINE_H
#define NL_STREAM_INLINE_H
#include <cstdio>
#include "types_nl.h"
#include "debug.h"
#include <cstdio>
namespace NLMISC
{

@ -19,6 +19,7 @@
#include "types_nl.h"
#include "common.h"
#include <map>
namespace NLMISC

@ -18,6 +18,7 @@
#define NL_STRING_ID_ARRAY_H
#include "types_nl.h"
#include "debug.h"
#include <cmath>
#include <string>
@ -25,8 +26,6 @@
#include <set>
#include <algorithm>
#include "debug.h"
namespace NLMISC {

@ -18,13 +18,12 @@
#define STRING_MAPPER_H
#include "types_nl.h"
#include "stream.h"
#include "mutex.h"
#include <vector>
#include <set>
#include "stream.h"
#include "mutex.h"
namespace NLMISC
{

@ -17,6 +17,7 @@
#ifndef NL_WIN32_UTIL_H
#define NL_WIN32_UTIL_H
#include "types_nl.h"
#ifdef NL_OS_WINDOWS

@ -355,8 +355,8 @@ bool CDriverD3D::activeShader(CShader *shd)
// Assemble the shader
LPD3DXBUFFER pErrorMsgs;
if (D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs)
== D3D_OK)
HRESULT hr = D3DXCreateEffect(_DeviceInterface, shd->getText(), (UINT)strlen(shd->getText())+1, NULL, NULL, 0, NULL, &(shaderInfo->Effect), &pErrorMsgs);
if (hr == D3D_OK)
{
// Get the texture handle
uint i;
@ -374,7 +374,7 @@ bool CDriverD3D::activeShader(CShader *shd)
}
else
{
nlwarning ("Can't create shader '%s':", shd->getName());
nlwarning ("Can't create shader '%s' (0x%x):", shd->getName(), hr);
if (pErrorMsgs)
nlwarning ((const char*)pErrorMsgs->GetBufferPointer());
shd->_ShaderChanged = false;

@ -27,7 +27,7 @@ ENDIF(WIN32)
NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
TARGET_LINK_LIBRARIES(${NLDRV_OGL_LIB} nel3d nelmisc ${OPENGL_gl_LIBRARY})
NL_DEFAULT_PROPS(${NLDRV_OGL_LIB} "NeL, Driver, Video: OpenGL")

@ -34,8 +34,8 @@ extern "C" {
/* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */
/* $Revision: 17614 $ on $Date: 2012-04-26 06:56:02 -0700 (Thu, 26 Apr 2012) $ */
#define EGL_EGLEXT_VERSION 12
/* $Revision: 19332 $ on $Date: 2012-09-28 17:56:20 -0700 (Fri, 28 Sep 2012) $ */
#define EGL_EGLEXT_VERSION 14
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
@ -293,6 +293,25 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
#endif
#ifndef EGL_ANDROID_image_native_buffer
#define EGL_ANDROID_image_native_buffer 1
struct ANativeWindowBuffer;
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
#endif
#ifndef EGL_ANDROID_swap_rectangle
#define EGL_ANDROID_swap_rectangle 1
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
#endif
#ifndef EGL_ANDROID_recordable
#define EGL_ANDROID_recordable 1
#define EGL_RECORDABLE_ANDROID 0x3142 /* EGLConfig attribute */
#endif
#ifndef EGL_ANGLE_query_surface_pointer
#define EGL_ANGLE_query_surface_pointer 1
#ifdef EGL_EGLEXT_PROTOTYPES
@ -333,38 +352,38 @@ typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
#define EGL_KHR_stream 1
typedef void* EGLStreamKHR;
typedef khronos_uint64_t EGLuint64KHR;
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
#define EGL_PRODUCER_FRAME_KHR 0x3212
#define EGL_CONSUMER_FRAME_KHR 0x3213
#define EGL_STREAM_STATE_KHR 0x3214
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
#define EGL_NO_STREAM_KHR ((EGLStreamKHR)0)
#define EGL_CONSUMER_LATENCY_USEC_KHR 0x3210
#define EGL_PRODUCER_FRAME_KHR 0x3212
#define EGL_CONSUMER_FRAME_KHR 0x3213
#define EGL_STREAM_STATE_KHR 0x3214
#define EGL_STREAM_STATE_CREATED_KHR 0x3215
#define EGL_STREAM_STATE_CONNECTING_KHR 0x3216
#define EGL_STREAM_STATE_EMPTY_KHR 0x3217
#define EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR 0x3218
#define EGL_STREAM_STATE_OLD_FRAME_AVAILABLE_KHR 0x3219
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
#define EGL_BAD_STREAM_KHR 0x321B
#define EGL_BAD_STATE_KHR 0x321C
#define EGL_STREAM_STATE_DISCONNECTED_KHR 0x321A
#define EGL_BAD_STREAM_KHR 0x321B
#define EGL_BAD_STATE_KHR 0x321C
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyStreamKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAttribKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStream64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamu64KHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMKHRPROC)(EGLDisplay dpy, const EGLint *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMATTRIBKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLint *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAM64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMU64KHRPROC)(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLuint64KHR *value);
#endif
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_consumer_gltexture
#define EGL_KHR_stream_consumer_gltexture 1
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
#define EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR 0x321E
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerGLTextureExternalKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerAcquireKHR(EGLDisplay dpy, EGLStreamKHR stream);
@ -379,7 +398,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMERRELEASEKHRPROC)(EGLDisplay
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_producer_eglsurface
#define EGL_KHR_stream_producer_eglsurface 1
#define EGL_STREAM_BIT_KHR 0x0800
#define EGL_STREAM_BIT_KHR 0x0800
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR(EGLDisplay dpy, EGLConfig config, EGLStreamKHR stream, const EGLint *attrib_list);
#endif /* EGL_EGLEXT_PROTOTYPES */
@ -397,10 +416,10 @@ typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)(EGLDi
#ifndef EGL_KHR_stream_fifo
#define EGL_KHR_stream_fifo 1
/* reuse EGLTimeKHR */
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
#define EGL_STREAM_FIFO_LENGTH_KHR 0x31FC
#define EGL_STREAM_TIME_NOW_KHR 0x31FD
#define EGL_STREAM_TIME_CONSUMER_KHR 0x31FE
#define EGL_STREAM_TIME_PRODUCER_KHR 0x31FF
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglQueryStreamTimeKHR(EGLDisplay dpy, EGLStreamKHR stream, EGLenum attribute, EGLTimeKHR *value);
#endif /* EGL_EGLEXT_PROTOTYPES */
@ -421,6 +440,47 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSTREAMTIMEKHRPROC)(EGLDisplay dpy, E
/* reuse EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE */
#endif
#ifndef EGL_KHR_create_context
#define EGL_KHR_create_context 1
#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION
#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB
#define EGL_CONTEXT_FLAGS_KHR 0x30FC
#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD
#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE
#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF
#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
#endif
#ifndef EGL_KHR_surfaceless_context
#define EGL_KHR_surfaceless_context 1
/* No tokens/entry points, just relaxes an error condition */
#endif
#ifdef EGL_KHR_stream /* Requires KHR_stream extension */
#ifndef EGL_KHR_stream_cross_process_fd
#define EGL_KHR_stream_cross_process_fd 1
typedef int EGLNativeFileDescriptorKHR;
#define EGL_NO_FILE_DESCRIPTOR_KHR ((EGLNativeFileDescriptorKHR)(-1))
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLNativeFileDescriptorKHR EGLAPIENTRY eglGetStreamFileDescriptorKHR(EGLDisplay dpy, EGLStreamKHR stream);
EGLAPI EGLStreamKHR EGLAPIENTRY eglCreateStreamFromFileDescriptorKHR(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif /* EGL_EGLEXT_PROTOTYPES */
typedef EGLNativeFileDescriptorKHR (EGLAPIENTRYP PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLStreamKHR stream);
typedef EGLStreamKHR (EGLAPIENTRYP PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC)(EGLDisplay dpy, EGLNativeFileDescriptorKHR file_descriptor);
#endif
#endif
#ifndef EGL_EXT_multiview_window
#define EGL_EXT_multiview_window 1
#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
#endif
#ifdef __cplusplus
}
#endif

File diff suppressed because it is too large Load Diff

@ -444,6 +444,10 @@ extern "C" {
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
#endif
#ifndef GLX_EXT_buffer_age
#define GLX_BACK_BUFFER_AGE_EXT 0x20F4
#endif
/*************************************************************/
@ -993,6 +997,10 @@ typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx,
#define GLX_EXT_swap_control_tear 1
#endif
#ifndef GLX_EXT_buffer_age
#define GLX_EXT_buffer_age 1
#endif
#ifdef __cplusplus
}

@ -1,7 +1,7 @@
#ifndef __glext_h_
#define __glext_h_
/* $Revision: 16481 $ on $Date:: 2012-01-04 10:43:56 -0800 #$ */
/* $Revision: 19260 $ on $Date:: 2012-09-20 11:30:36 -0700 #$ */
#ifdef __cplusplus
extern "C" {
@ -165,6 +165,9 @@ typedef void* GLeglImageOES;
#define GL_DEPTH24_STENCIL8_OES 0x88F0
#endif
/* GL_OES_required_internalformat */
/* No new tokens introduced by this extension. */
/* GL_OES_rgb8_rgba8 */
#ifndef GL_OES_rgb8_rgba8
#define GL_RGB8_OES 0x8051
@ -240,7 +243,7 @@ typedef void* GLeglImageOES;
* APPLE extension tokens
*------------------------------------------------------------------------*/
/* GL_APPLE_texture_2D_limited_npot */
/* GL_APPLE_copy_texture_levels */
/* No new tokens introduced by this extension. */
/* GL_APPLE_framebuffer_multisample */
@ -254,6 +257,41 @@ typedef void* GLeglImageOES;
#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
#endif
/* GL_APPLE_sync */
#ifndef GL_APPLE_sync
/* These types are defined with reference to <inttypes.h>
* in the Apple extension spec, but here we use the Khronos
* portable types in khrplatform.h, and assume those types
* are always defined.
* If any other extensions using these types are defined,
* the typedefs must move out of this block and be shared.
*/
typedef khronos_int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef struct __GLsync *GLsync;
#define GL_SYNC_OBJECT_APPLE 0x8A53
#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111
#define GL_OBJECT_TYPE_APPLE 0x9112
#define GL_SYNC_CONDITION_APPLE 0x9113
#define GL_SYNC_STATUS_APPLE 0x9114
#define GL_SYNC_FLAGS_APPLE 0x9115
#define GL_SYNC_FENCE_APPLE 0x9116
#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
#define GL_UNSIGNALED_APPLE 0x9118
#define GL_SIGNALED_APPLE 0x9119
#define GL_ALREADY_SIGNALED_APPLE 0x911A
#define GL_TIMEOUT_EXPIRED_APPLE 0x911B
#define GL_CONDITION_SATISFIED_APPLE 0x911C
#define GL_WAIT_FAILED_APPLE 0x911D
#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001
#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull
#endif
/* GL_APPLE_texture_2D_limited_npot */
/* No new tokens introduced by this extension. */
/* GL_APPLE_texture_format_BGRA8888 */
#ifndef GL_APPLE_texture_format_BGRA8888
#define GL_BGRA_EXT 0x80E1
@ -288,12 +326,23 @@ typedef void* GLeglImageOES;
#define GL_STENCIL_EXT 0x1802
#endif
/* GL_EXT_map_buffer_range */
#ifndef GL_EXT_map_buffer_range
#define GL_MAP_READ_BIT_EXT 0x0001
#define GL_MAP_WRITE_BIT_EXT 0x0002
#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004
#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008
#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010
#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020
#endif
/* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
#define GL_RENDERBUFFER_SAMPLES_EXT 0x9133
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x9134
#define GL_MAX_SAMPLES_EXT 0x9135
/* reuse values from GL_EXT_framebuffer_multisample (desktop extension) */
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
#define GL_MAX_SAMPLES_EXT 0x8D57
#endif
/* GL_EXT_multi_draw_arrays */
@ -353,10 +402,10 @@ typedef void* GLeglImageOES;
/* GL_EXT_texture_storage */
#ifndef GL_EXT_texture_storage
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
#define GL_ALPHA8_EXT 0x803C
#define GL_ALPHA8_EXT 0x803C
#define GL_LUMINANCE8_EXT 0x8040
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
#define GL_RGBA32F_EXT 0x8814
#define GL_RGBA32F_EXT 0x8814
#define GL_RGB32F_EXT 0x8815
#define GL_ALPHA32F_EXT 0x8816
#define GL_LUMINANCE32F_EXT 0x8818
@ -366,7 +415,7 @@ typedef void* GLeglImageOES;
#define GL_ALPHA16F_EXT 0x881C
#define GL_LUMINANCE16F_EXT 0x881E
#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
#define GL_RGB10_A2_EXT 0x8059
#define GL_RGB10_A2_EXT 0x8059
#define GL_RGB10_EXT 0x8052
#define GL_BGRA8_EXT 0x93A1
#endif
@ -771,6 +820,11 @@ typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type,
#define GL_OES_packed_depth_stencil 1
#endif
/* GL_OES_required_internalformat */
#ifndef GL_OES_required_internalformat
#define GL_OES_required_internalformat 1
#endif
/* GL_OES_query_matrix */
#ifndef GL_OES_query_matrix
#define GL_OES_query_matrix 1
@ -892,9 +946,13 @@ typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
* APPLE extension functions
*------------------------------------------------------------------------*/
/* GL_APPLE_texture_2D_limited_npot */
#ifndef GL_APPLE_texture_2D_limited_npot
#define GL_APPLE_texture_2D_limited_npot 1
/* GL_APPLE_copy_texture_levels */
#ifndef GL_APPLE_copy_texture_levels
#define GL_APPLE_copy_texture_levels 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
#endif
typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
#endif
/* GL_APPLE_framebuffer_multisample */
@ -908,6 +966,32 @@ typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum
typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
#endif
/* GL_APPLE_sync */
#ifndef GL_APPLE_sync
#define GL_APPLE_sync 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
#endif
typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
#endif
/* GL_APPLE_texture_2D_limited_npot */
#ifndef GL_APPLE_texture_2D_limited_npot
#define GL_APPLE_texture_2D_limited_npot 1
#endif
/* GL_APPLE_texture_format_BGRA8888 */
#ifndef GL_APPLE_texture_format_BGRA8888
#define GL_APPLE_texture_format_BGRA8888 1
@ -945,6 +1029,17 @@ GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttac
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
#endif
/* GL_EXT_map_buffer_range */
#ifndef GL_EXT_map_buffer_range
#define GL_EXT_map_buffer_range 1
#ifdef GL_GLEXT_PROTOTYPES
GL_API void GL_APIENTRY *glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
#endif
typedef void* (GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
#endif
/* GL_EXT_multisampled_render_to_texture */
#ifndef GL_EXT_multisampled_render_to_texture
#define GL_EXT_multisampled_render_to_texture 1
@ -1068,8 +1163,8 @@ typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn
GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
/*------------------------------------------------------------------------*

@ -161,21 +161,12 @@ const uint CDriverGL::_EVSNumConstant = 97;
GLenum CDriverGL::NLCubeFaceToGLCubeFace[6] =
{
#ifdef USE_OPENGLES
GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
#else
GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
#endif
};
// ***************************************************************************

@ -77,6 +77,13 @@ typedef void (APIENTRY * NEL_PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pnam
#define GL_INTERPOLATE_EXT GL_INTERPOLATE
#define GL_BUMP_ENVMAP_ATI GL_INTERPOLATE
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
#else
// ***************************************************************************

@ -205,8 +205,8 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
return false;
}
// ***************************************************************************
#ifndef USE_OPENGLES
static
inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{
@ -216,16 +216,11 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{
switch(comp)
{
#ifdef USE_OPENGLES
case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES;
case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES;
case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES;
#else
case CVPSwizzle::X: return GL_X_EXT;
case CVPSwizzle::Y: return GL_Y_EXT;
case CVPSwizzle::Z: return GL_Z_EXT;
case CVPSwizzle::W: return GL_W_EXT;
#endif
default:
nlstop;
return 0;
@ -236,16 +231,11 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
{
switch(comp)
{
#ifdef USE_OPENGLES
case CVPSwizzle::X: return GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES;
case CVPSwizzle::Y: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES;
case CVPSwizzle::Z: return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES;
#else
case CVPSwizzle::X: return GL_NEGATIVE_X_EXT;
case CVPSwizzle::Y: return GL_NEGATIVE_Y_EXT;
case CVPSwizzle::Z: return GL_NEGATIVE_Z_EXT;
case CVPSwizzle::W: return GL_NEGATIVE_W_EXT;
#endif
default:
nlstop;
return 0;
@ -253,6 +243,7 @@ inline GLenum convSwizzleToGLFormat(CVPSwizzle::EComp comp, bool negate)
}
}
}
#endif
// ***************************************************************************
/** Convert an output register to a EXTVertexShader register

@ -109,7 +109,7 @@ CRGBA CFastHLSModifier::convert(uint H, uint L, uint S)
return col;
}
#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10)
#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# pragma warning( push )
# pragma warning( disable : 4799 )
#endif
@ -262,7 +262,7 @@ uint16 CFastHLSModifier::applyHLSMod(uint16 colorIn, uint8 dHue, uint dLum, uin
#pragma managed(pop)
#endif
#if defined(NL_COMP_VC71) || defined(NL_COMP_VC8) || defined(NL_COMP_VC9) || defined(NL_COMP_VC10)
#if defined(NL_COMP_VC) && NL_COMP_VC_VERSION >= 71
# pragma warning( pop )
#endif

@ -127,7 +127,7 @@ void CZone::build(const CZoneInfo &zoneInfo, uint32 numVertices)
// Compute the bbox and the bias/scale.
//=====================================
CAABBox bb;
if(patchs.size())
if(!patchs.empty())
bb.setCenter(patchs[0].Patch.Vertices[0]);
bb.setHalfSize(CVector::Null);
for(j=0;j<(sint)patchs.size();j++)

@ -21,6 +21,10 @@
#include "nel/misc/bsphere.h"
#include "nel/misc/matrix.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -21,6 +21,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -19,6 +19,10 @@
#include "nel/misc/dynloadlib.h"
#include "nel/misc/command.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -23,6 +23,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -22,6 +22,9 @@
using namespace std;
using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -25,6 +25,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -20,6 +20,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -26,6 +26,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -32,6 +32,9 @@ extern "C"
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -27,6 +27,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -21,6 +21,9 @@
// remove stupid VC6 warnings
void foo_block_memory_cpp() {}
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -21,6 +21,9 @@
using namespace NLMISC;
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -26,6 +26,10 @@ using namespace std;
// if 0, don't stat the time of different function
#define STAT_FIFO 1
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
#ifdef BUFFIFO_TRACK_ALL_BUFFERS

@ -23,6 +23,9 @@
#include "nel/misc/stream.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -17,9 +17,14 @@
#include "stdmisc.h"
#include "nel/misc/class_registry.h"
#include "nel/misc/debug.h"
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -24,6 +24,10 @@
#include "nel/misc/cmd_args.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -22,6 +22,10 @@
using namespace std;
using namespace NLMISC;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
//ICommand::TCategorySet* ICommand::_Categories;

@ -15,9 +15,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#include "nel/misc/cpu_time_stat.h"
#include "nel/misc/cpu_time_stat.h"
#include "nel/misc/common.h"
#include "nel/misc/debug.h"
#ifdef NL_OS_UNIX
#include <unistd.h>
@ -27,6 +28,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -28,7 +28,9 @@
#ifdef NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -21,6 +21,10 @@
#ifdef NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -27,6 +27,10 @@
#include "Mmsystem.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -23,6 +23,10 @@
#ifdef NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -22,6 +22,9 @@
using namespace NLMISC;
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace STRING_MANAGER
{

@ -21,6 +21,10 @@
#ifdef NL_OS_WINDOWS
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -21,6 +21,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -31,6 +31,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
//

@ -20,6 +20,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
const uint64 CEntityId::MaxEntityId = ((uint64)1 << (CEntityId::ID_SIZE + 1)) - (uint64)1;

@ -17,6 +17,11 @@
#include "stdmisc.h"
#include "nel/misc/eval_num_expr.h"
#include "nel/misc/debug.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -19,6 +19,10 @@
// remove stupid VC6 warnings
void foo_event_emitter_cpp() {}
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -18,6 +18,10 @@
#include "nel/misc/event_emitter_multi.h"
#include "nel/misc/system_utils.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -20,6 +20,9 @@
#include "nel/misc/event_server.h"
#include "nel/misc/events.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -21,6 +21,9 @@
#include "nel/misc/event_emitter.h"
#include "nel/misc/events.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -19,6 +19,9 @@
#include "nel/misc/events.h"
#include "nel/misc/string_conversion.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -18,6 +18,10 @@
#include "nel/misc/fast_floor.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
int OptFastFloorCWStack[OptFastFloorCWStackSize];

@ -35,6 +35,10 @@
// Project includes
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
void dummytoavoidthecompilerwarningfastidmap() { }

@ -19,6 +19,9 @@
#include "nel/misc/fast_mem.h"
#include "nel/misc/system_info.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -15,9 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#ifndef NL_OS_WINDOWS
#include <errno.h>
#endif
#include "nel/misc/file.h"
#include "nel/misc/debug.h"
#include "nel/misc/big_file.h"
@ -26,10 +24,18 @@
#include "nel/misc/sstring.h"
#include "nel/misc/xml_pack.h"
#ifndef NL_OS_WINDOWS
#include <errno.h>
#endif
using namespace std;
#define NLMISC_DONE_FILE_OPENED 40
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -17,6 +17,10 @@
#include "stdmisc.h"
#include "nel/misc/game_device.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -18,6 +18,10 @@
#include "nel/misc/game_device_events.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -24,6 +24,10 @@ void dummyToAvoidStupidCompilerWarning_misc_geom_ext_cpp()
{
}
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -19,6 +19,10 @@
#include "nel/misc/grid_traversal.h"
#include "nel/misc/vector_2f.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -15,6 +15,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#include "nel/misc/gtk_displayer.h"
#ifdef NL_USE_GTK
@ -35,10 +36,12 @@
#include "nel/misc/command.h"
#include "nel/misc/thread.h"
#include "nel/misc/gtk_displayer.h"
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
//

@ -26,6 +26,10 @@
#include "nel/misc/time_nl.h"
#endif
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -22,6 +22,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {
CI18N::StrMapContainer CI18N::_StrMap;

@ -28,6 +28,10 @@ using namespace std;
#define NLMISC_READ_BUFFER_SIZE 1024
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -20,6 +20,10 @@
// remove stupid VC6 warnings
void foo_input_device_cpp() {}
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -15,10 +15,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdmisc.h"
#include "nel/misc/input_device_server.h"
#include "nel/misc/input_device.h"
#include "nel/misc/debug.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -16,12 +16,16 @@
#include "stdmisc.h"
#ifdef NL_OS_WINDOWS
#include "nel/misc/inter_window_msg_queue.h"
//
#ifdef NL_OS_WINDOWS
#include "nel/misc/mem_stream.h"
#include "nel/misc/shared_memory.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -18,6 +18,9 @@
//#include "nel/3d/u_keyboard_device.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NL3D {

@ -18,6 +18,10 @@
#include "nel/misc/line.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -23,6 +23,9 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -52,6 +52,10 @@ documentation and/or software.
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{
// ****************************************************************************

@ -37,6 +37,10 @@
using namespace std;
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -18,6 +18,10 @@
#include "nel/misc/mem_stream.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -17,6 +17,10 @@
#include "stdmisc.h"
#include "nel/misc/mouse_smoother.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

@ -22,6 +22,7 @@
#include "nel/misc/mutex.h"
#include "nel/misc/time_nl.h"
#include "nel/misc/debug.h"
using namespace std;
@ -47,6 +48,9 @@ using namespace std;
#define NOMINMAX
#include <windows.h>
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC {

@ -20,6 +20,9 @@
#include "nel/misc/fast_floor.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLMISC
{

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

Loading…
Cancel
Save