diff --git a/docs/maintainers/vcpkg_configure_cmake.md b/docs/maintainers/vcpkg_configure_cmake.md index f61a6fa204..b78ef54d90 100644 --- a/docs/maintainers/vcpkg_configure_cmake.md +++ b/docs/maintainers/vcpkg_configure_cmake.md @@ -8,6 +8,7 @@ vcpkg_configure_cmake( SOURCE_PATH <${SOURCE_PATH}> [PREFER_NINJA] [DISABLE_PARALLEL_CONFIGURE] + [NO_CHARSET_FLAG] [GENERATOR <"NMake Makefiles">] [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...] [OPTIONS_RELEASE <-DOPTIMIZE=1>...] @@ -27,6 +28,11 @@ Disables running the CMake configure step in parallel. This is needed for libraries which write back into their source directory during configure. +### NO_CHARSET_FLAG +Disables passing `utf-8` as the default character set to `CMAKE_C_FLAGS` and `CMAKE_CXX_FLAGS`. + +This is needed for libraries that set their own source code's character set. + ### GENERATOR Specifies the precise generator to use. diff --git a/ports/duilib/CONTROL b/ports/duilib/CONTROL index 9154664ea1..cb4c7ed3fa 100644 --- a/ports/duilib/CONTROL +++ b/ports/duilib/CONTROL @@ -1,3 +1,3 @@ Source: duilib -Version: 2019-4-28-1 +Version: 2019-4-28-2 Description: Duilib is a free open source DirectUI interface library under Windows. It is widely accepted by major Internet companies due to its simple and easy to expand design and stable and efficient implementation. It is widely used in IM, video client, stock market software, navigation software, and mobile phone assistive software. Duilib is still evolving, and will continue to improve in many aspects such as documentation, examples, animations, and rendering engines. diff --git a/ports/duilib/portfile.cmake b/ports/duilib/portfile.cmake index 7e30c99406..5556d22cdb 100644 --- a/ports/duilib/portfile.cmake +++ b/ports/duilib/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH}/DuiLib PREFER_NINJA + NO_CHARSET_FLAG ) vcpkg_build_cmake() diff --git a/ports/msix/CONTROL b/ports/msix/CONTROL index ae41a6ba1f..848e95be3e 100644 --- a/ports/msix/CONTROL +++ b/ports/msix/CONTROL @@ -1,5 +1,5 @@ Source: msix -Version: MsixCoreInstaller-preview +Version: MsixCoreInstaller-preview-1 Build-Depends: xerces-c, zlib, openssl (!uwp&!windows) Description: The MSIX Packaging SDK project is an effort to enable developers on a variety of platforms to pack and unpack packages for the purposes of distribution from either the Microsoft Store, or their own content distribution networks. The MSIX Packaging APIs that a client app would use to interact with .msix/.appx packages are a subset of those documented here. See sample/ExtractContentsSample/ExtractContentsSample.cpp for additional details. diff --git a/ports/msix/portfile.cmake b/ports/msix/portfile.cmake index 1445e58453..7d8924ee62 100644 --- a/ports/msix/portfile.cmake +++ b/ports/msix/portfile.cmake @@ -31,6 +31,7 @@ endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + NO_CHARSET_FLAG OPTIONS -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON -DINSTALL_LIBMSIX=ON diff --git a/ports/thrift/CONTROL b/ports/thrift/CONTROL index c3f2f83c98..2ee3ef03e7 100644 --- a/ports/thrift/CONTROL +++ b/ports/thrift/CONTROL @@ -1,5 +1,5 @@ Source: thrift -Version: 2019-05-07-1 +Version: 2019-05-07-2 Build-Depends: zlib, libevent, openssl, boost-range, boost-smart-ptr, boost-date-time, boost-locale, boost-scope-exit Homepage: https://github.com/apache/thrift Description: Apache Thrift is a software project spanning a variety of programming languages and use cases. Our goal is to make reliable, performant communication and data serialization across languages as efficient and seamless as possible. diff --git a/ports/thrift/portfile.cmake b/ports/thrift/portfile.cmake index c19b38c312..c7fd84003a 100644 --- a/ports/thrift/portfile.cmake +++ b/ports/thrift/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + NO_CHARSET_FLAG OPTIONS -DWITH_STDTHREADS=ON -DBUILD_TESTING=off diff --git a/ports/tidy-html5/CONTROL b/ports/tidy-html5/CONTROL index 0f608ea2de..af8276ee5f 100644 --- a/ports/tidy-html5/CONTROL +++ b/ports/tidy-html5/CONTROL @@ -1,4 +1,4 @@ Source: tidy-html5 -Version: 5.6.0 +Version: 5.6.0-1 Homepage: https://github.com/htacg/tidy-html5 Description: Tidy tidies HTML and XML. It can tidy your documents by itself, and developers can easily integrate its features into even more powerful tools. diff --git a/ports/tidy-html5/portfile.cmake b/ports/tidy-html5/portfile.cmake index 7cb7ca65f1..e599049235 100644 --- a/ports/tidy-html5/portfile.cmake +++ b/ports/tidy-html5/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA + NO_CHARSET_FLAG OPTIONS -DBUILD_SHARED_LIB=OFF -DTIDY_CONSOLE_SHARED=OFF diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index c17bd68c8e..ab93c30750 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -51,7 +51,7 @@ ## * [poco](https://github.com/Microsoft/vcpkg/blob/master/ports/poco/portfile.cmake) ## * [opencv](https://github.com/Microsoft/vcpkg/blob/master/ports/opencv/portfile.cmake) function(vcpkg_configure_cmake) - cmake_parse_arguments(_csc "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) + cmake_parse_arguments(_csc "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;NO_CHARSET_FLAG" "SOURCE_PATH;GENERATOR" "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE" ${ARGN}) if(NOT VCPKG_PLATFORM_TOOLSET) message(FATAL_ERROR "Vcpkg has been updated with VS2017 support, however you need to rebuild vcpkg.exe by re-running bootstrap-vcpkg.bat\n") @@ -174,6 +174,11 @@ function(vcpkg_configure_cmake) else() message(FATAL_ERROR "You must set both the VCPKG_CXX_FLAGS and VCPKG_C_FLAGS") endif() + + set(VCPKG_SET_CHARSET_FLAG ON) + if(_csc_NO_CHARSET_FLAG) + set(VCPKG_SET_CHARSET_FLAG OFF) + endif() if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE) list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}") @@ -189,8 +194,10 @@ function(vcpkg_configure_cmake) list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/freebsd.cmake") endif() + list(APPEND _csc_OPTIONS "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" + "-DVCPKG_SET_CHARSET_FLAG=${VCPKG_SET_CHARSET_FLAG}" "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 12b1ae7f98..d5d7f8db51 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -9,7 +9,8 @@ if(NOT _CMAKE_IN_TRY_COMPILE) message(FATAL_ERROR "Invalid setting for VCPKG_CRT_LINKAGE: \"${VCPKG_CRT_LINKAGE}\". It must be \"static\" or \"dynamic\"") endif() - if(VCPKG_PLATFORM_TOOLSET MATCHES "v120") + set(CHARSET_FLAG "/utf-8") + if (NOT VCPKG_SET_CHARSET_FLAG OR VCPKG_PLATFORM_TOOLSET MATCHES "v120") # VS 2013 does not support /utf-8 set(CHARSET_FLAG) endif() @@ -17,7 +18,7 @@ if(NOT _CMAKE_IN_TRY_COMPILE) set(CMAKE_CXX_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /GR /EHsc /MP ${VCPKG_CXX_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS " /DWIN32 /D_WINDOWS /W3 ${CHARSET_FLAG} /MP ${VCPKG_C_FLAGS}" CACHE STRING "") set(CMAKE_RC_FLAGS "-c65001 /DWIN32" CACHE STRING "") - + unset(CHARSET_FLAG) set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG ${VCPKG_CRT_LINK_FLAG_PREFIX}d /Z7 /Ob0 /Od /RTC1 ${VCPKG_CXX_FLAGS_DEBUG}" CACHE STRING "") @@ -27,5 +28,4 @@ if(NOT _CMAKE_IN_TRY_COMPILE) set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF ${VCPKG_LINKER_FLAGS}" CACHE STRING "") - endif() diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 9694bce4c1..1975d3aaf3 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -1007,6 +1007,12 @@ namespace vcpkg::Build hash += "-"; hash += Hash::get_file_hash(fs, *p, "SHA1"); } + else if (pre_build_info.cmake_system_name.empty() || + pre_build_info.cmake_system_name == "WindowsStore") + { + hash += "-"; + hash += Hash::get_file_hash(fs, paths.scripts / "toolchains" / "windows.cmake", "SHA1"); + } else if (pre_build_info.cmake_system_name == "Linux") { hash += "-";