aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDailyShana <p2357111317192329@gmail.com>2020-02-14 15:00:31 +0800
committerGitHub <noreply@github.com>2020-02-13 23:00:31 -0800
commit1be75a28bfce2084bb0b59ec92a6853f13d7be66 (patch)
treefd5ef4e95f7b085033722561683cdf1fc90c7696
parentb9794a59a308a1315d8ce1b394c23dfcc03cc79f (diff)
downloadvcpkg-1be75a28bfce2084bb0b59ec92a6853f13d7be66.tar.gz
vcpkg-1be75a28bfce2084bb0b59ec92a6853f13d7be66.zip
[irrlicht] add feature to support unicode path on windows (#9902)
* [irrlicht] add feature to support unicode path on windows * use vcpkg_check_features * fix tools feature
-rw-r--r--ports/irrlicht/CMakeLists.txt17
-rw-r--r--ports/irrlicht/CONTROL5
-rw-r--r--ports/irrlicht/fix-encoding.patch13
-rw-r--r--ports/irrlicht/portfile.cmake32
4 files changed, 41 insertions, 26 deletions
diff --git a/ports/irrlicht/CMakeLists.txt b/ports/irrlicht/CMakeLists.txt
index 3eda8264a..e17d718d8 100644
--- a/ports/irrlicht/CMakeLists.txt
+++ b/ports/irrlicht/CMakeLists.txt
@@ -8,9 +8,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Irrlicht directories
# -------------------------------------------------------------------------------------------------
-set(IRR_ROOT_DIR "")
set(IRR_SRC_DIR "source/Irrlicht")
set(IRR_INC_DIR "include")
+set(IRR_TOOL_DIR "tools")
# Options
# -------------------------------------------------------------------------------------------------
@@ -19,6 +19,7 @@ if(DEFINED ENV{DXSDK_DIR})
set(DXSDK "ENV{DXSDK_DIR}")
endif()
+set(IRR_UNICODE_PATH 0 CACHE BOOL "Whether to enable unicode path support on windows")
set(IRR_FAST_MATH 0 CACHE BOOL "Whether to enable fast maths (at the expense of precision)")
set(IRR_SHARED_LIB 1 CACHE BOOL "Whether to generate shared libraries instead of static libraries")
set(IRR_DIRECTX_SDK ${DXSDK} CACHE PATH "Path to the DirectX SDK (for DirectX 9, this folder should contain /Include, /Lib)")
@@ -43,10 +44,10 @@ glob_c_cpp_sources(IRR_SRC_FILES_INTERFACE ${IRR_INC_DIR})
glob_c_cpp_sources(IRR_SRC_FILES_AESGLADMAN ${IRR_SRC_DIR}/aesGladman)
glob_c_cpp_sources(IRR_SRC_FILES_LZMA ${IRR_SRC_DIR}/lzma)
-glob_c_cpp_sources(IRR_TOOL_FILES_FILE_TO_HEADER ${IRR_ROOT_DIR}/tools/FileToHeader/)
-glob_c_cpp_sources(IRR_TOOL_FILES_GUI_EDITOR ${IRR_ROOT_DIR}/tools/GUIEditor/)
-glob_c_cpp_sources(IRR_TOOL_FILES_FONT_TOOL ${IRR_ROOT_DIR}/tools/IrrFontTool/newFontTool/)
-glob_c_cpp_sources(IRR_TOOL_FILES_MESH_CONVERTER ${IRR_ROOT_DIR}/tools/MeshConverter/)
+glob_c_cpp_sources(IRR_TOOL_FILES_FILE_TO_HEADER ${IRR_TOOL_DIR}/FileToHeader/)
+glob_c_cpp_sources(IRR_TOOL_FILES_GUI_EDITOR ${IRR_TOOL_DIR}/GUIEditor/)
+glob_c_cpp_sources(IRR_TOOL_FILES_FONT_TOOL ${IRR_TOOL_DIR}/IrrFontTool/newFontTool/)
+glob_c_cpp_sources(IRR_TOOL_FILES_MESH_CONVERTER ${IRR_TOOL_DIR}/MeshConverter/)
# Group files
# -------------------------------------------------------------------------------------------------
@@ -161,6 +162,12 @@ if(WIN32)
# Multi processor compilation
target_compile_options(Irrlicht PRIVATE /MP)
+ # Unicode
+ if(${IRR_UNICODE_PATH})
+ target_compile_definitions(Irrlicht PRIVATE UNICODE _UNICODE)
+ target_compile_definitions(Irrlicht PUBLIC _IRR_WCHAR_FILESYSTEM)
+ endif()
+
# Fast math options
if(${IRR_FAST_MATH})
target_compile_options(Irrlicht PRIVATE /fp:fast)
diff --git a/ports/irrlicht/CONTROL b/ports/irrlicht/CONTROL
index 155b2f38b..5870178c2 100644
--- a/ports/irrlicht/CONTROL
+++ b/ports/irrlicht/CONTROL
@@ -1,9 +1,12 @@
Source: irrlicht
-Version: 1.8.4-4
+Version: 1.8.4-5
Homepage: http://irrlicht.sourceforge.net
Description: Irrlicht lightning fast 3d engine
Build-Depends: zlib, libpng, bzip2, libjpeg-turbo
+Feature: unicode
+Description: Support unicode path on windows
+
Feature: fast-fpu
Description: Enable fast maths (at the expense of precision)
diff --git a/ports/irrlicht/fix-encoding.patch b/ports/irrlicht/fix-encoding.patch
new file mode 100644
index 000000000..d01bfad51
--- /dev/null
+++ b/ports/irrlicht/fix-encoding.patch
@@ -0,0 +1,13 @@
+diff --git a/include/Keycodes.h b/include/Keycodes.h
+index e56eca1..57ab312 100644
+--- a/include/Keycodes.h
++++ b/include/Keycodes.h
+@@ -89,7 +89,7 @@ namespace irr
+ KEY_KEY_X = 0x58, // X key
+ KEY_KEY_Y = 0x59, // Y key
+ KEY_KEY_Z = 0x5A, // Z key
+- KEY_LWIN = 0x5B, // Left Windows key (Microsoft® Natural® keyboard)
++ KEY_LWIN = 0x5B, // Left Windows key (Microsoft® Natural® keyboard)
+ KEY_RWIN = 0x5C, // Right Windows key (Natural keyboard)
+ KEY_APPS = 0x5D, // Applications key (Natural keyboard)
+ KEY_SLEEP = 0x5F, // Computer Sleep key
diff --git a/ports/irrlicht/portfile.cmake b/ports/irrlicht/portfile.cmake
index 09e42c954..f10e80422 100644
--- a/ports/irrlicht/portfile.cmake
+++ b/ports/irrlicht/portfile.cmake
@@ -1,5 +1,3 @@
-include(vcpkg_common_functions)
-
vcpkg_download_distfile(ARCHIVE
URLS "https://downloads.sourceforge.net/project/irrlicht/Irrlicht%20SDK/1.8/1.8.4/irrlicht-1.8.4.zip"
FILENAME "irrlicht-1.8.4.zip"
@@ -10,24 +8,21 @@ vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF "1.8.4"
- # [NO_REMOVE_ONE_LEVEL]
- # [WORKING_DIRECTORY <${CURRENT_BUILDTREES_DIR}/src>]
- # [PATCHES <a.patch>...]
+ PATCHES
+ "fix-encoding.patch"
)
# Copy CMakeLists.txt to the source, because Irrlicht does not have one.
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY ${CMAKE_CURRENT_LIST_DIR}/LICENSE.txt DESTINATION ${SOURCE_PATH})
-set(FAST_MATH FALSE)
-if("fast-fpu" IN_LIST FEATURES)
- set(FAST_MATH TRUE)
-endif()
-
-set(BUILD_TOOLS FALSE)
-if("tools" IN_LIST FEATURES)
- set(BUILD_TOOLS TRUE)
-endif()
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ unicode IRR_UNICODE_PATH
+ fast-fpu IRR_FAST_MATH
+ tools IRR_BUILD_TOOLS
+)
set(SHARED_LIB TRUE)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
@@ -38,18 +33,15 @@ vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA # Disable this option if project cannot be built with Ninja
OPTIONS
- -DIRR_SHARED_LIB=${SHARED_LIB}
- -DIRR_FAST_MATH=${FAST_MATH}
- -DIRR_BUILD_TOOLS=${BUILD_TOOLS}
- # OPTIONS_RELEASE -DOPTIMIZE=1
- # OPTIONS_DEBUG -DDEBUGGABLE=1
+ -DIRR_SHARED_LIB=${SHARED_LIB}
+ ${FEATURE_OPTIONS}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
-if(BUILD_TOOLS)
+if("tools" IN_LIST FEATURES)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/irrlicht/)
endif()