diff options
Diffstat (limited to 'deps/icu-small/source/tools/pkgdata/pkgdata.cpp')
-rw-r--r-- | deps/icu-small/source/tools/pkgdata/pkgdata.cpp | 62 |
1 files changed, 47 insertions, 15 deletions
diff --git a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp index bf93318602..d4dc271732 100644 --- a/deps/icu-small/source/tools/pkgdata/pkgdata.cpp +++ b/deps/icu-small/source/tools/pkgdata/pkgdata.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /****************************************************************************** * Copyright (C) 2000-2016, International Business Machines @@ -26,7 +26,7 @@ #include "putilimp.h" #if U_HAVE_POPEN -#if (U_PF_MINGW <= U_PLATFORM || U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__) +#if (U_PF_MINGW <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN) && defined(__STRICT_ANSI__) /* popen/pclose aren't defined in strict ANSI on Cygwin and MinGW */ #undef __STRICT_ANSI__ #endif @@ -121,7 +121,9 @@ enum { LIBNAME, QUIET, WITHOUT_ASSEMBLY, - PDS_BUILD + PDS_BUILD, + UWP_BUILD, + UWP_ARM_BUILD }; /* This sets the modes that are available */ @@ -163,7 +165,9 @@ static UOption options[]={ /*18*/ UOPTION_DEF( "libname", 'L', UOPT_REQUIRES_ARG), /*19*/ UOPTION_DEF( "quiet", 'q', UOPT_NO_ARG), /*20*/ UOPTION_DEF( "without-assembly", 'w', UOPT_NO_ARG), - /*21*/ UOPTION_DEF( "zos-pds-build", 'z', UOPT_NO_ARG) + /*21*/ UOPTION_DEF("zos-pds-build", 'z', UOPT_NO_ARG), + /*22*/ UOPTION_DEF("windows-uwp-build", 'u', UOPT_NO_ARG), + /*23*/ UOPTION_DEF("windows-uwp-arm-build", 'a', UOPT_NO_ARG) }; /* This enum and the following char array should be kept in sync. */ @@ -250,9 +254,11 @@ const char options_help[][320]={ "Specify a version when packaging in dll or static mode", "Add package to all file names if not present", "Library name to build (if different than package name)", - "Quite mode. (e.g. Do not output a readme file for static libraries)", + "Quiet mode. (e.g. Do not output a readme file for static libraries)", "Build the data without assembly code", - "Build PDS dataset (zOS build only)" + "Build PDS dataset (zOS build only)", + "Build for Universal Windows Platform (Windows build only)", + "Set DLL machine type for UWP to target windows ARM (Windows UWP build only)" }; const char *progname = "PKGDATA"; @@ -1751,7 +1757,14 @@ static int32_t pkg_createWithoutAssemblyCode(UPKGOptions *o, const char *targetD #ifdef WINDOWS_WITH_MSVC #define LINK_CMD "link.exe /nologo /release /out:" -#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /base:0x4ad00000 /implib:" +#define LINK_FLAGS "/DLL /NOENTRY /MANIFEST:NO /implib:" +#ifdef _WIN64 +#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /DYNAMICBASE /APPCONTAINER " +#else +#define LINK_EXTRA_UWP_FLAGS "/NXCOMPAT /SAFESEH /DYNAMICBASE /APPCONTAINER /MACHINE:X86" +#endif +#define LINK_EXTRA_UWP_FLAGS_ARM "/NXCOMPAT /DYNAMICBASE /APPCONTAINER /MACHINE:ARM" +#define LINK_EXTRA_NO_UWP_FLAGS "/base:0x4ad00000 " #define LIB_CMD "LIB.exe /nologo /out:" #define LIB_FILE "icudt.lib" #define LIB_EXT UDATA_LIB_SUFFIX @@ -1831,14 +1844,33 @@ static int32_t pkg_createWindowsDLL(const char mode, const char *gencFilePath, U return 0; } - sprintf(cmd, "%s\"%s\" %s\"%s\" \"%s\" %s", - LINK_CMD, - dllFilePath, - LINK_FLAGS, - libFilePath, - gencFilePath, - resFilePath - ); + char *extraFlags = ""; +#ifdef WINDOWS_WITH_MSVC + if (options[UWP_BUILD].doesOccur) + { + if (options[UWP_ARM_BUILD].doesOccur) + { + extraFlags = LINK_EXTRA_UWP_FLAGS_ARM; + } + else + { + extraFlags = LINK_EXTRA_UWP_FLAGS; + } + } + else + { + extraFlags = LINK_EXTRA_NO_UWP_FLAGS; + } +#endif + sprintf(cmd, "%s\"%s\" %s %s\"%s\" \"%s\" %s", + LINK_CMD, + dllFilePath, + extraFlags, + LINK_FLAGS, + libFilePath, + gencFilePath, + resFilePath + ); } result = runCommand(cmd, TRUE); |