From 390d987557e57be8d8bc95edd499d5309be73306 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:22:10 +0200 Subject: [PATCH 01/12] Fixed: Variable "success" uninitialized if HTML content is empty --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 479f28738..19b82f169 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4218,6 +4218,8 @@ namespace NLGUI removeContent(); endBuild(); + + success = false; } else { From ca75cc4deabc81fd0e9dc436b61ec58939b1994b Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:26:09 +0200 Subject: [PATCH 02/12] Fixed: Variable "fx" uninitialized if _Lines is empty --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index 8458def52..e773a6cb1 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -2405,6 +2405,7 @@ namespace NLGUI if (_Lines.empty()) { x = 0; + fx = 0; } else { From a8097f47d470fe9f7b21f96a432caf3f9312b236 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:28:34 +0200 Subject: [PATCH 03/12] Changed: Replace spaces by tabs --HG-- branch : develop --- code/nel/src/gui/view_text.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/code/nel/src/gui/view_text.cpp b/code/nel/src/gui/view_text.cpp index e773a6cb1..9efd2074d 100644 --- a/code/nel/src/gui/view_text.cpp +++ b/code/nel/src/gui/view_text.cpp @@ -850,10 +850,10 @@ namespace NLGUI prop = (char*) xmlGetProp( cur, (xmlChar*)"justification" ); if (prop) { - if (nlstricmp("clip_word", (const char *) prop) == 0) _TextMode = ClipWord; - else if (nlstricmp("dont_clip_word", (const char *) prop) == 0) _TextMode = DontClipWord; - else if (nlstricmp("justified", (const char *) prop) == 0) _TextMode = Justified; - else if (nlstricmp("centered", (const char *) prop) == 0) _TextMode = Centered; + if (nlstricmp("clip_word", (const char *) prop) == 0) _TextMode = ClipWord; + else if (nlstricmp("dont_clip_word", (const char *) prop) == 0) _TextMode = DontClipWord; + else if (nlstricmp("justified", (const char *) prop) == 0) _TextMode = Justified; + else if (nlstricmp("centered", (const char *) prop) == 0) _TextMode = Centered; else nlwarning(" bad text mode"); } @@ -1094,11 +1094,12 @@ namespace NLGUI else mouseIn= isIn(x,y); // if the mouse cursor is in the clip area - if(mouseIn) { - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+_HReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); - rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + if(mouseIn) + { + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal+_HReal, _WReal, 1, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); + rVR.drawRotFlipBitmap (_RenderLayer, _XReal+_WReal, _YReal, 1, _HReal, 0, false, rVR.getBlankTextureId(), CRGBA(200,200,200,255)); } } #endif @@ -1111,7 +1112,7 @@ namespace NLGUI return; // hack: allow shadow to overflow outside parent box. - // In CGroupHTML context, clip is set for row + // In CGroupHTML context, clip is set for row if (std::abs(_ShadowX) > 0) { ClipX -= 3; @@ -2373,7 +2374,7 @@ namespace NLGUI } // *************************************************************************** - void CViewText::setColorRGBA(NLMISC::CRGBA col) + void CViewText::setColorRGBA(NLMISC::CRGBA col) { _Color = col; } @@ -2405,7 +2406,7 @@ namespace NLGUI if (_Lines.empty()) { x = 0; - fx = 0; + fx = 0; } else { @@ -2543,7 +2544,7 @@ namespace NLGUI TextContext->setOblique (_Oblique); // find the line where the character is // CViewRenderer &rVR = *CViewRenderer::getInstance(); - uint charPos = 0; + uint charPos = 0; if (_MultiLine) { y -= getMultiMinOffsetY() * _Scale; From f190869d59013d745a8019db3d6d26688dafd3f1 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:40:24 +0200 Subject: [PATCH 04/12] Fixed: Support for VC++ 2019 (don't use registry anymore but CMAKE_CXX_COMPILER instead) --HG-- branch : develop --- code/CMakeModules/FindMSVC.cmake | 169 ++++++++----------------- code/CMakeModules/FindWindowsSDK.cmake | 23 +++- 2 files changed, 71 insertions(+), 121 deletions(-) diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake index 5dbc4f6a8..2a08a08bb 100644 --- a/code/CMakeModules/FindMSVC.cmake +++ b/code/CMakeModules/FindMSVC.cmake @@ -1,89 +1,55 @@ # - Find MS Visual C++ # +# VC_DIR - where to find Visual C++ # VC_INCLUDE_DIR - where to find headers # VC_INCLUDE_DIRS - where to find headers # 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) - - 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() +# VC_FOUND - True if MSVC found + +IF(CMAKE_CXX_COMPILER) + SET(_COMPILER ${CMAKE_CXX_COMPILER}) + SET(_VERSION ${CMAKE_CXX_COMPILER_VERSION}) +ELSEIF(CMAKE_C_COMPILER) + SET(_COMPILER ${CMAKE_C_COMPILER}) + SET(_VERSION ${CMAKE_C_COMPILER_VERSION}) +ELSE() + MESSAGE(FATAL_ERROR "No way to determine Visual C++ location") +ENDIF() - IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") - SET(VC${_VERSION}_FOUND ON) - DETECT_EXPRESS_VERSION(${_VERSION}) - IF(NOT MSVC_FIND_QUIETLY) - SET(_VERSION_STR ${_VERSION}) - IF(MSVC_EXPRESS) - SET(_VERSION_STR "${_VERSION_STR} Express") - ENDIF() - MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}") - ENDIF() - ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry") - SET(VC${_VERSION}_FOUND OFF) - SET(VC${_VERSION}_DIR "") +IF(MSVC_VERSION LESS 1910) + IF(MSVC_VERSION LESS 1500) + MESSAGE(FATAL_ERROR "Unsupported version of Visual C++ (minimum version is 2008)") + ELSEIF(MSVC_VERSION LESS 1600) + SET(MSVC_TOOLSET "90") + SET(_NAME "2008") + ELSEIF(MSVC_VERSION LESS 1700) + SET(MSVC_TOOLSET "100") + SET(_NAME "2010") + ELSEIF(MSVC_VERSION LESS 1800) + SET(MSVC_TOOLSET "110") + SET(_NAME "2012") + ELSEIF(MSVC_VERSION LESS 1900) + SET(MSVC_TOOLSET "120") + SET(_NAME "2013") + ELSE() + SET(MSVC_TOOLSET "140") + SET(_NAME "2015") ENDIF() -ENDMACRO() - -MACRO(DETECT_VC_VERSION _VERSION) - IF(NOT VC_FOUND) - SET(VC${_VERSION}_FOUND OFF) - DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION}) - IF(NOT VC${_VERSION}_FOUND) - DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION}) - ENDIF() + STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER}) - IF(VC${_VERSION}_FOUND) - SET(VC_FOUND ON) - SET(VC_DIR "${VC${_VERSION}_DIR}") - ENDIF() - ENDIF() -ENDMACRO() - -MACRO(DETECT_EXPRESS_VERSION _VERSION) - GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE) + MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION}) in ${VC_DIR}") +ELSE() + # Toolset = version of runtime DLLs + SET(MSVC_TOOLSET "140") - IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry") - SET(MSVC_EXPRESS ON) + IF(MSVC_VERSION LESS 1920) + SET(_NAME "2017") + ELSE() + SET(_NAME "2019") ENDIF() -ENDMACRO() - -IF(MSVC_VERSION GREATER 1909) - DETECT_VC_VERSION("15.0") - SET(MSVC_TOOLSET "140") - SET(VC_DIR "${VC_DIR}Tools/MSVC") + STRING(REGEX REPLACE "/MSVC/.+" "/MSVC" VC_DIR ${_COMPILER}) FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*") @@ -92,48 +58,15 @@ IF(MSVC_VERSION GREATER 1909) 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") -ELSEIF(MSVC14) - DETECT_VC_VERSION("14.0") - SET(MSVC_TOOLSET "140") -ELSEIF(MSVC12) - DETECT_VC_VERSION("12.0") - SET(MSVC_TOOLSET "120") -ELSEIF(MSVC11) - DETECT_VC_VERSION("11.0") - SET(MSVC_TOOLSET "110") -ELSEIF(MSVC10) - DETECT_VC_VERSION("10.0") - SET(MSVC_TOOLSET "100") -ELSEIF(MSVC90) - DETECT_VC_VERSION("9.0") - SET(MSVC_TOOLSET "90") -ELSEIF(MSVC80) - DETECT_VC_VERSION("8.0") - SET(MSVC_TOOLSET "80") -ENDIF() + IF(MSVC_TOOLCHAIN_VERSIONS) + LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION) -# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable -IF(NOT VC_DIR) - SET(VC_DIR $ENV{VC_DIR}) - # Fix path - FILE(TO_CMAKE_PATH ${VC_DIR} VC_DIR) -ENDIF() + SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}") -IF(NOT VC_DIR) - IF(CMAKE_CXX_COMPILER) - SET(_COMPILER ${CMAKE_CXX_COMPILER}) + MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION} with toolchain ${MSVC_TOOLCHAIN_VERSION}) in ${VC_DIR}") ELSE() - SET(_COMPILER ${CMAKE_C_COMPILER}) + MESSAGE(FATAL_ERROR "Unable to find Visual C++ in ${VC_DIR}") ENDIF() - STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER}) ENDIF() IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}") @@ -147,14 +80,14 @@ SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist") IF(NOT EXISTS "${MSVC_REDIST_DIR}") SET(MSVC_REDIST_DIR "${VC_DIR}/redist") - + IF(NOT EXISTS "${MSVC_REDIST_DIR}") SET(MSVC_REDIST_DIR) ENDIF() ENDIF() IF(MSVC_REDIST_DIR) - IF(MSVC1411 OR MSVC1410) + IF(MSVC_VERSION GREATER 1909) # 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 "${MSVC_REDIST_DIR}") @@ -167,7 +100,7 @@ IF(MSVC_REDIST_DIR) # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}") ELSEIF(MSVC10) - # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist + # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}") ELSEIF(MSVC90) SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}") @@ -176,7 +109,11 @@ IF(MSVC_REDIST_DIR) ENDIF() ENDIF() -MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}") +IF(VC_INCLUDE_DIR) + MESSAGE(STATUS "Using VC++ headers from ${VC_INCLUDE_DIR}") +ELSE() + MESSAGE(FATAL_ERROR "Unable to find VC++ headers") +ENDIF() SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR}) diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake index 3d9c43bd9..1b02dffb3 100644 --- a/code/CMakeModules/FindWindowsSDK.cmake +++ b/code/CMakeModules/FindWindowsSDK.cmake @@ -20,6 +20,7 @@ MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION) IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry" AND EXISTS "${WINSDK${_VERSION}_DIR}/Include") SET(WINSDK${_VERSION}_FOUND ON) GET_FILENAME_COMPONENT(WINSDK${_VERSION}_VERSION_FULL "[${_ROOT}\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v${_VERSION};ProductVersion]" NAME) + IF(NOT WindowsSDK_FIND_QUIETLY) MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}") ENDIF() @@ -28,14 +29,14 @@ MACRO(DETECT_WINSDK_VERSION_HELPER _ROOT _VERSION) ENDIF() ENDMACRO() -MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX) - GET_FILENAME_COMPONENT(WINSDK${_VERSION}_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot${_SUFFIX}]" ABSOLUTE) +MACRO(DETECT_WINKIT_VERSION_HELPER _VERSION _SUFFIX _PREFIX _ARCH) + GET_FILENAME_COMPONENT(WINSDK${_VERSION}_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\${_PREFIX}Microsoft\\Windows Kits\\Installed Roots;KitsRoot${_SUFFIX}]" ABSOLUTE) - IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry") + IF(WINSDK${_VERSION}_DIR AND NOT WINSDK${_VERSION}_DIR STREQUAL "/registry" AND EXISTS "${WINSDK${_VERSION}_DIR}/Include") SET(WINSDK${_VERSION}_FOUND ON) SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}") IF(NOT WindowsSDK_FIND_QUIETLY) - MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}") + MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR} (registry ${_ARCH} bits)") ENDIF() LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION}) ELSE() @@ -52,6 +53,14 @@ MACRO(DETECT_WINSDK_VERSION _VERSION) ENDIF() ENDMACRO() +MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX) + DETECT_WINKIT_VERSION_HELPER("${_VERSION}" "${_SUFFIX}" "WOW6432Node\\\\" "32") + + IF(NOT WINSDK${_VERSION}_FOUND) + DETECT_WINKIT_VERSION_HELPER("${_VERSION}" "${_SUFFIX}" "" "64") + ENDIF() +ENDMACRO() + SET(WINSDK_DETECTED_VERSIONS) # Fixed versions for Windows Kits (VC++ from 2012) @@ -378,7 +387,11 @@ FIND_PATH(WINSDK_INCLUDE_DIR Windows.h NO_DEFAULT_PATH ) -MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}") +IF(WINSDK_INCLUDE_DIR) + MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}") +ELSE() + MESSAGE(FATAL_ERROR "Unable to find Windows.h") +ENDIF() # directory where WinRT headers are found FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h From 61a137797a5adcefef741296564e3e923523ed91 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:40:44 +0200 Subject: [PATCH 05/12] Changed: Updated toolchains --HG-- branch : develop --- code/CMakeModules/OSXToolChain.cmake | 30 +++++++++++++++++++--------- code/CMakeModules/iOSToolChain.cmake | 16 +++++++-------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/code/CMakeModules/OSXToolChain.cmake b/code/CMakeModules/OSXToolChain.cmake index 3169aec78..d480c13b8 100644 --- a/code/CMakeModules/OSXToolChain.cmake +++ b/code/CMakeModules/OSXToolChain.cmake @@ -1,11 +1,11 @@ # Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11 # # Example: -# cmake ../code -DCMAKE_TOOLCHAIN_FILE=../code/CMakeModules/OSXToolChain.cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_INSTALLER=OFF -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_WARNINGS=OFF -DWITH_QT5=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_SANDBOX=OFF -DOSX_SDK=10.11 +# cmake .. -DCMAKE_TOOLCHAIN_FILE=$CMAKE_MODULE_PATH/OSXToolChain.cmake -DOSX_SDK=10.14 # Don't forget to define environment variables: # -# export MACOSX_DEPLOYMENT_TARGET=10.7 +# export MACOSX_DEPLOYMENT_TARGET=10.8 # export OSXCROSS_GCC_NO_STATIC_RUNTIME=1 # export PATH=$PATH:/home/src/osxcross/target/bin # @@ -15,18 +15,22 @@ # ./osxcross-macports install libxml2 jpeg curl libogg libvorbis freetype boost openssl zlib lua-5.3 giflib # to compile Luabind -# export CMAKE_MODULE_PATH=$HOME/shard/tools/external/cmake/modules -# cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/ryzomcore/code/CMakeModules/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external +# cmake .. -DCMAKE_TOOLCHAIN_FILE=$CMAKE_MODULE_PATH/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external IF(DEFINED CMAKE_CROSSCOMPILING) # subsequent toolchain loading is not really needed RETURN() ENDIF() +# OSXCROSS_TARGET +# OSXCROSS_SDK + # Force the compilers to Clang for OS X +SET(OSXCROSS_HOST "x86_64-apple-darwin18") + # C -SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang) +SET(CMAKE_C_COMPILER ${OSXCROSS_HOST}-clang) SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11") SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert") SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") @@ -34,7 +38,7 @@ SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") # C++ -SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++) +SET(CMAKE_CXX_COMPILER ${OSXCROSS_HOST}-clang++) SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17") SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") @@ -102,8 +106,8 @@ SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk) # Standard settings SET(CMAKE_SYSTEM_NAME Darwin) -SET(CMAKE_SYSTEM "Darwin-15.0.0") -SET(CMAKE_SYSTEM_VERSION "15.0.0") +SET(CMAKE_SYSTEM "Darwin-18.0.0") +SET(CMAKE_SYSTEM_VERSION "18.0.0") SET(CMAKE_SYSTEM_PROCESSOR "x86_64") SET(UNIX ON) @@ -123,9 +127,17 @@ SET(CMAKE_SYSTEM_FRAMEWORK_PATH ) # only search the OS X sdks, not the remainder of the host filesystem -SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) # determinate location for bin utils based on CMAKE_FIND_ROOT_PATH INCLUDE(CMakeFindBinUtils) + +set(CMAKE_AR "${OSXCROSS_HOST}-ar" CACHE FILEPATH "ar") +set(CMAKE_RANLIB "${OSXCROSS_HOST}-ranlib" CACHE FILEPATH "ranlib") +set(CMAKE_INSTALL_NAME_TOOL "${OSXCROSS_HOST}-install_name_tool" CACHE FILEPATH "install_name_tool") + +set(ENV{PKG_CONFIG_LIBDIR} "${MACPORTS_ROOT_DIR}/lib/pkgconfig") +set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs") diff --git a/code/CMakeModules/iOSToolChain.cmake b/code/CMakeModules/iOSToolChain.cmake index 7bcb57227..37c483afb 100644 --- a/code/CMakeModules/iOSToolChain.cmake +++ b/code/CMakeModules/iOSToolChain.cmake @@ -137,23 +137,23 @@ SET(CMAKE_IOS_SIMULATOR_SYSROOT ${CMAKE_IOS_SIMULATOR_SDK_ROOT} CACHE PATH "Sysr IF(CMAKE_GENERATOR MATCHES Xcode) IF(${IOS_PLATFORM} STREQUAL "OS") - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") - SET(CMAKE_SYSTEM_PROCESSOR "x86") + SET(CMAKE_SYSTEM_PROCESSOR "x86_64") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ENDIF() ELSE() IF(${IOS_PLATFORM} STREQUAL "OS") SET(ARCHS armv7 arm64) - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR") - # iPhone simulator targets i386 - SET(ARCHS "i386") + # iPhone simulator targets x86_64 + SET(ARCHS "x86_64") SET(CMAKE_SYSTEM_PROCESSOR "x86") ELSEIF(${IOS_PLATFORM} STREQUAL "ALL") - SET(ARCHS armv7 arm64 i386 x86_64) - SET(CMAKE_SYSTEM_PROCESSOR "armv7") + SET(ARCHS armv7 arm64 x86_64) + SET(CMAKE_SYSTEM_PROCESSOR "arm64") ENDIF() ENDIF() From fb93157afde7c3a229d8717db0e4e92e066db363 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:45:10 +0200 Subject: [PATCH 06/12] Changed: Use FIND_PACKAGE_HELPER --HG-- branch : develop --- code/CMakeModules/FindFMOD.cmake | 56 ++--------------- code/CMakeModules/FindLuabind.cmake | 43 +------------ code/CMakeModules/FindOgg.cmake | 50 +-------------- code/CMakeModules/FindSTLport.cmake | 94 ++--------------------------- code/CMakeModules/FindSquish.cmake | 73 +--------------------- code/CMakeModules/FindVorbis.cmake | 67 ++------------------ 6 files changed, 19 insertions(+), 364 deletions(-) diff --git a/code/CMakeModules/FindFMOD.cmake b/code/CMakeModules/FindFMOD.cmake index b28f77b1e..3bdd09e8f 100644 --- a/code/CMakeModules/FindFMOD.cmake +++ b/code/CMakeModules/FindFMOD.cmake @@ -1,57 +1,9 @@ -# - Locate FMOD library -# This module defines -# FMOD_LIBRARY, the library to link against -# FMOD_FOUND, if false, do not try to link to FMOD -# FMOD_INCLUDE_DIR, where to find headers. - -IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) - # in cache already - SET(FMOD_FIND_QUIETLY TRUE) -ENDIF() - - -FIND_PATH(FMOD_INCLUDE_DIR - fmod.h - PATHS - $ENV{FMOD_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES fmod fmod3 -) +INCLUDE(FindHelpers) IF(TARGET_X64) - SET(FMOD_LIBRARY_NAMES fmod64 fmod) + SET(FMOD_BASE fmod64) ELSE() - SET(FMOD_LIBRARY_NAMES fmodvc fmod) + SET(FMOD_BASE fmodvc) ENDIF() -FIND_LIBRARY(FMOD_LIBRARY - NAMES - ${FMOD_LIBRARY_NAMES} - PATHS - $ENV{FMOD_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR) - SET(FMOD_FOUND "YES") - IF(NOT FMOD_FIND_QUIETLY) - MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}") - ENDIF() -ELSE() - IF(NOT FMOD_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find FMOD!") - ENDIF() -ENDIF() +FIND_PACKAGE_HELPER(FMOD fmod.h RELEASE ${FMOD_BASE} DEBUG ${FMOD_BASE}d SUFFIXES fmod3) diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake index 5511379a3..dae1dbd99 100644 --- a/code/CMakeModules/FindLuabind.cmake +++ b/code/CMakeModules/FindLuabind.cmake @@ -3,6 +3,7 @@ # LUABIND_LIBRARIES, the libraries to link against # LUABIND_FOUND, if false, do not try to link to LUABIND # LUABIND_INCLUDE_DIR, where to find headers. +INCLUDE(FindHelpers) MACRO(FIND_CORRECT_LUA_VERSION) # Check Lua version linked to Luabind under Linux @@ -85,18 +86,6 @@ IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) SET(Luabind_FIND_QUIETLY TRUE) ENDIF() -FIND_PATH(LUABIND_INCLUDE_DIR - luabind/luabind.hpp - PATHS - $ENV{LUABIND_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - SET(LIBRARY_NAME_RELEASE) SET(LIBRARY_NAME_DEBUG) @@ -149,35 +138,7 @@ ENDIF() LIST(APPEND LIBRARY_NAME_RELEASE luabind libluabind) LIST(APPEND LIBRARY_NAME_DEBUG luabind_d luabindd libluabind_d libluabindd) -FIND_LIBRARY(LUABIND_LIBRARY_RELEASE - NAMES ${LIBRARY_NAME_RELEASE} - PATHS - $ENV{LUABIND_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(LUABIND_LIBRARY_DEBUG - NAMES ${LIBRARY_NAME_DEBUG} - PATHS - $ENV{LUABIND_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) +FIND_PACKAGE_HELPER(Luabind luabind/luabind.hpp RELEASE ${LIBRARY_NAME_RELEASE} DEBUG ${LIBRARY_NAME_DEBUG}) FIND_PACKAGE(Boost REQUIRED) diff --git a/code/CMakeModules/FindOgg.cmake b/code/CMakeModules/FindOgg.cmake index c1f4492e1..aa2f9164c 100644 --- a/code/CMakeModules/FindOgg.cmake +++ b/code/CMakeModules/FindOgg.cmake @@ -1,49 +1,3 @@ -# - Locate Ogg library -# This module defines -# OGG_LIBRARY, the library to link against -# OGG_FOUND, if false, do not try to link to OGG -# OGG_INCLUDE_DIR, where to find headers. +INCLUDE(FindHelpers) -IF(OGG_LIBRARY AND OGG_INCLUDE_DIR) - # in cache already - SET(OGG_FIND_QUIETLY TRUE) -ENDIF() - - -FIND_PATH(OGG_INCLUDE_DIR - ogg/ogg.h - PATHS - $ENV{OGG_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -FIND_LIBRARY(OGG_LIBRARY - NAMES ogg libogg - PATHS - $ENV{OGG_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(OGG_LIBRARY AND OGG_INCLUDE_DIR) - SET(OGG_FOUND "YES") - IF(NOT OGG_FIND_QUIETLY) - MESSAGE(STATUS "Found Ogg: ${OGG_LIBRARY}") - ENDIF() -ELSE() - IF(NOT OGG_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Ogg!") - ENDIF() -ENDIF() +FIND_PACKAGE_HELPER(Ogg ogg/ogg.h) diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake index 68e542ea5..3b1cc1800 100644 --- a/code/CMakeModules/FindSTLport.cmake +++ b/code/CMakeModules/FindSTLport.cmake @@ -1,91 +1,5 @@ -# Look for a directory containing STLport. -# -# The following values are defined -# STLPORT_INCLUDE_DIR - where to find vector, etc. -# STLPORT_LIBRARIES - link against these to use STLport -# STLPORT_FOUND - True if the STLport is available. +INCLUDE(FindHelpers) -# also defined, but not for general use are -IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR) - # in cache already - SET(STLPORT_FIND_QUIETLY TRUE) -ENDIF() - -FIND_PATH(STLPORT_INCLUDE_DIR - iostream - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES stlport -) - -FIND_LIBRARY(STLPORT_LIBRARY_DEBUG - NAMES - stlport_cygwin_debug - stlport_cygwin_stldebug - stlport_gcc_debug - stlport_gcc_stldebug - stlportstld_x - stlportstld_x.5.2 - stlportd - stlportd_statix - stlportd_static - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(STLPORT_LIBRARY_RELEASE - NAMES - stlport_cygwin - stlport_gcc - stlport - stlport_x - stlport_x.5.2 - stlport_statix - stlport_static - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(STLPORT_INCLUDE_DIR) - IF(STLPORT_LIBRARY_RELEASE) - SET(STLPORT_FOUND TRUE) - - SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE}) - IF(STLPORT_LIBRARY_DEBUG) - SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG}) - ENDIF() - ENDIF() -ENDIF() - -IF(STLPORT_FOUND) - IF(NOT STLPORT_FIND_QUIETLY) - MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}") - ENDIF() -ELSE() - IF(NOT STLPORT_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find STLport!") - ENDIF() -ENDIF() - -MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG) +FIND_PACKAGE_HELPER(STLport iostream + RELEASE stlport_cygwin stlport_gcc stlport_x stlport_x.5.2 stlport_statix stlport_static + DEBUG stlport_cygwin_debug stlport_cygwin_stldebug stlport_gcc_debug stlport_gcc_stldebug stlportstld_x stlportstld_x.5.2 stlportd_statix stlportd_static) diff --git a/code/CMakeModules/FindSquish.cmake b/code/CMakeModules/FindSquish.cmake index 4242f4055..9d0928f87 100644 --- a/code/CMakeModules/FindSquish.cmake +++ b/code/CMakeModules/FindSquish.cmake @@ -1,69 +1,6 @@ -# -# Find the LibSquish includes and library -# -# This module defines -# SQUISH_INCLUDE_DIR, where to find squish.h -# SQUISH_LIBRARIES, where to find the Squish libraries. -# SQUISH_FOUND, If false, do not try to use Squish. +INCLUDE(FindHelpers) -# also defined, but not for general use are -IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR) - # in cache already - SET(SQUISH_FIND_QUIETLY TRUE) -ENDIF() - -FIND_PATH(SQUISH_INCLUDE_DIR - squish.h - PATHS - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include - PATH_SUFFIXES cppunit -) - -FIND_LIBRARY(SQUISH_LIBRARY_RELEASE - squish - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(SQUISH_LIBRARY_DEBUG - squishd - PATHS - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -IF(SQUISH_INCLUDE_DIR) - IF(SQUISH_LIBRARY_RELEASE) - SET(SQUISH_FOUND "YES") - SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}") - IF(SQUISH_LIBRARY_DEBUG) - SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}") - ELSE() - SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}") - MESSAGE("Debug Squish NOT found, using the release version!") - ENDIF() - ENDIF() -ENDIF() +FIND_PACKAGE_HELPER(Squish squish.h) IF(SQUISH_FOUND) IF(NOT SQUISH_FIND_QUIETLY) @@ -74,10 +11,4 @@ IF(SQUISH_FOUND) SET(SQUISH_COMPRESS_HAS_METRIC ON) SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC) ENDIF() -ELSE() - IF(NOT SQUISH_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Squish!") - ENDIF() ENDIF() - -MARK_AS_ADVANCED(SQUISH_LIBRARY_RELEASE SQUISH_LIBRARY_DEBUG) diff --git a/code/CMakeModules/FindVorbis.cmake b/code/CMakeModules/FindVorbis.cmake index 234d2d31a..b0a4ec2a6 100644 --- a/code/CMakeModules/FindVorbis.cmake +++ b/code/CMakeModules/FindVorbis.cmake @@ -1,65 +1,8 @@ -# - Locate Vorbis library -# This module defines -# VORBIS_LIBRARY, the library to link against -# VORBIS_FOUND, if false, do not try to link to VORBIS -# VORBIS_INCLUDE_DIR, where to find headers. +INCLUDE(FindHelpers) -IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR) - # in cache already - SET(VORBIS_FIND_QUIETLY TRUE) -ENDIF() - - -FIND_PATH(VORBIS_INCLUDE_DIR - vorbis/vorbisfile.h - PATHS - $ENV{VORBIS_DIR}/include - /usr/local/include - /usr/include - /sw/include - /opt/local/include - /opt/csw/include - /opt/include -) - -FIND_LIBRARY(VORBIS_LIBRARY - NAMES vorbis libvorbis - PATHS - $ENV{VORBIS_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) - -FIND_LIBRARY(VORBISFILE_LIBRARY - NAMES vorbisfile libvorbisfile - PATHS - $ENV{VORBIS_DIR}/lib - /usr/local/lib - /usr/lib - /usr/local/X11R6/lib - /usr/X11R6/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib - /usr/freeware/lib64 -) +FIND_PACKAGE_HELPER(Vorbis vorbisenc.h) +FIND_PACKAGE_HELPER(VorbisFile vorbisfile.h SUFFIXES vorbis) -IF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR) - SET(VORBIS_FOUND "YES") - SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY}) - IF(NOT VORBIS_FIND_QUIETLY) - MESSAGE(STATUS "Found Vorbis: ${VORBIS_LIBRARY}") - ENDIF() -ELSE() - IF(NOT VORBIS_FIND_QUIETLY) - MESSAGE(STATUS "Warning: Unable to find Vorbis!") - ENDIF() +IF(VORBISFILE_FOUND) + SET(VORBIS_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISFILE_LIBRARIES}) ENDIF() From 0914828ee2c2de0595d725c5be68577f6fa0abad Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:45:57 +0200 Subject: [PATCH 07/12] Fixed: Tools compilation (sheets_packer_shard requires server code) --HG-- branch : develop --- code/ryzom/tools/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/ryzom/tools/CMakeLists.txt b/code/ryzom/tools/CMakeLists.txt index b97c9be8e..e42303691 100644 --- a/code/ryzom/tools/CMakeLists.txt +++ b/code/ryzom/tools/CMakeLists.txt @@ -21,7 +21,7 @@ IF(WITH_RYZOM_TOOLS) IF(WIN32) IF(MYSQL_FOUND) - ADD_SUBDIRECTORY(sheets_packer_shard) + #ADD_SUBDIRECTORY(sheets_packer_shard) ENDIF() ENDIF() ENDIF() From 9d9819f1c0b733b05802dff0a2349504d85f5eb8 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 19:48:33 +0200 Subject: [PATCH 08/12] Changed: Updated NeL module --HG-- branch : develop --- code/CMakeModules/FindNeL.cmake | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/code/CMakeModules/FindNeL.cmake b/code/CMakeModules/FindNeL.cmake index e75163cce..96dd90b83 100644 --- a/code/CMakeModules/FindNeL.cmake +++ b/code/CMakeModules/FindNeL.cmake @@ -13,7 +13,6 @@ # NELXXX_FOUND # NELXXX_LIBRARIES - INCLUDE(FindHelpers) # Init all variables we'll set @@ -209,6 +208,20 @@ IF(NELMISC_FOUND) LIST(APPEND NELMISC_LIBRARIES ${LIBXML2_LIBRARIES}) ENDIF() + IF(CMAKE_DL_LIBS) + LIST(APPEND NELMISC_LIBRARIES ${CMAKE_DL_LIBS}) + ENDIF() + + FIND_PACKAGE(Threads) + + IF(Threads_FOUND) + LIST(APPEND NELMISC_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + ENDIF() + + IF(UNIX AND NOT APPLE) + LIST(APPEND NELMISC_LIBRARIES rt) + ENDIF() + LIST(REMOVE_ITEM NeL_FIND_COMPONENTS misc) LIST(APPEND NEL_MODULES_FOUND misc) @@ -262,11 +275,17 @@ FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) FIND_PACKAGE_HELPER(${_NAME} nel/${COMPONENT}/${HEADER_FILE} RELEASE nel${COMPONENT}_r nel${COMPONENT} DEBUG nel${COMPONENT}_d + DIR ${NEL_DIR} QUIET) IF(${_UPNAME}_FOUND) LIST(APPEND NEL_MODULES_FOUND ${COMPONENT}) + # all NeL libraries depend on nelmisc in static + IF(NEL_STATIC) + LIST(APPEND ${_UPNAME}_LIBRARIES ${NELMISC_LIBRARIES}) + ENDIF() + IF(COMPONENT STREQUAL "3d") IF(NEL_STATIC) # 3rd party dependencies @@ -301,7 +320,9 @@ FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) ELSEIF(COMPONENT STREQUAL "gui") FIND_PACKAGE(Luabind REQUIRED) - LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES}) + IF(LUABIND_FOUND) + LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES}) + ENDIF() FIND_LIBCURL() @@ -323,7 +344,6 @@ FOREACH(COMPONENT ${NeL_FIND_COMPONENTS}) LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES}) - LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES} ${CURL_LIBRARIES}) LIST(APPEND NEL_DEFINITIONS ${${_UPNAME}_DEFINITIONS}) ELSEIF(COMPONENT STREQUAL "sound") FIND_PACKAGE(Ogg REQUIRED) From 71b65b956449a20a25f3fd51f2eb32df215d758d Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 11 Oct 2019 20:00:16 +0200 Subject: [PATCH 09/12] Fixed: Use nlUtf8ToWide macro instead of utf8ToWide function --HG-- branch : develop --- code/nel/src/misc/app_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/misc/app_context.cpp b/code/nel/src/misc/app_context.cpp index a7381d026..73c9aa1b3 100644 --- a/code/nel/src/misc/app_context.cpp +++ b/code/nel/src/misc/app_context.cpp @@ -135,7 +135,7 @@ CApplicationContext::~CApplicationContext() std::string message = toString("Instance '%s' still allocated at %p", it->first.c_str(), it->second); #ifdef NL_OS_WINDOWS - OutputDebugStringW(utf8ToWide(message)); + OutputDebugStringW(nlUtf8ToWide(message)); #else printf("%s\n", message.c_str()); #endif From 1d5580a2d6f4084d9b6f6e17ed13f4584df0d2a1 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 20 Oct 2019 22:35:05 +0300 Subject: [PATCH 10/12] Fixed: Force stop css downloads when starting to browse new url. --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 19b82f169..db2db7748 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -2586,6 +2586,7 @@ namespace NLGUI // go _URL = uri.toString(); _BrowseNextTime = true; + _WaitingForStylesheet = false; // if a BrowseTree is bound to us, try to select the node that opens this URL (auto-locate) if(!_BrowseTree.empty()) From fc9d423c94e49f9b368c76a5dc11b74461e472d8 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 20 Oct 2019 22:35:05 +0300 Subject: [PATCH 11/12] Fixed: Possible deadlock when css url not removed from stylehseet queue --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index db2db7748..98b908c7d 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -4163,7 +4163,7 @@ namespace NLGUI void CGroupHTML::renderDocument() { - if (!_StylesheetQueue.empty()) + if (!Curls.empty() && !_StylesheetQueue.empty()) { // waiting for stylesheets to finish downloading return; From fec9975f5854c1e816ff0c1504d5d7aa07527a88 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sun, 20 Oct 2019 22:35:05 +0300 Subject: [PATCH 12/12] Fixed: Downloaded css file was not used --HG-- branch : develop --- code/nel/src/gui/group_html.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 98b908c7d..23bd2e671 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -659,10 +659,12 @@ namespace NLGUI if (download.type == StylesheetType) { - // no tmpfile if file was already in cache - if (CFile::fileExists(tmpfile) && CFile::fileExists(download.dest)) + if (CFile::fileExists(tmpfile)) { - CFile::deleteFile(download.dest); + if (CFile::fileExists(download.dest)) + { + CFile::deleteFile(download.dest); + } CFile::moveFile(download.dest, tmpfile); } cssDownloadFinished(download.url, download.dest);