diff --git a/ports/mpir/CONTROL b/ports/mpir/CONTROL index 79238cbb55c429..58d1c7b37452ba 100644 --- a/ports/mpir/CONTROL +++ b/ports/mpir/CONTROL @@ -1,5 +1,5 @@ Source: mpir -Version: 3.0.0-7 +Version: 3.0.0-8 Homepage: https://github.com/wbhart/mpir Description: Multiple Precision Integers and Rationals. -Supports: !uwp \ No newline at end of file +Supports: !uwp diff --git a/ports/pbc/CONTROL b/ports/pbc/CONTROL index 1577832fd66730..d42d1ac520e627 100644 --- a/ports/pbc/CONTROL +++ b/ports/pbc/CONTROL @@ -1,6 +1,6 @@ Source: pbc -Version: 0.5.14-2 +Version: 0.5.14-3 Build-Depends: mpir (windows) Homepage: https://crypto.stanford.edu/pbc Description: Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems. -Supports: !uwp \ No newline at end of file +Supports: !uwp diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index d049c907b96398..3f5d026ec697e9 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -39,14 +39,35 @@ function(vcpkg_build_cmake) set(PARALLEL_ARG) set(NO_PARALLEL_ARG) + if(NOT DEFINED _bc_VS_PLATFORM_TOOLSET) + set(_bc_VS_PLATFORM_TOOLSET ${VS_PLATFORM_TOOLSET}) + endif() + if(_VCPKG_CMAKE_GENERATOR MATCHES "Ninja") set(BUILD_ARGS "-v") # verbose output set(NO_PARALLEL_ARG "-j1") elseif(_VCPKG_CMAKE_GENERATOR MATCHES "Visual Studio") set(BUILD_ARGS "/p:VCPkgLocalAppDataDisabled=true" - "/p:UseIntelMKL=No" + "/p:UseInteloneMKL=No" + "/v:n"##q[uiet], m[inimal], n[ormal], d[etailed] e diag[nostic] + "/nologo" + "/p:VcpkgTriplet=${TARGET_TRIPLET}" ) + if(DEFINED _bc_VS_PLATFORM_TOOLSET) + list(APPEND BUILD_ARGS + "/p:BasePlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:PlatformToolset=${VS_PLATFORM_TOOLSET}" +# "/p:UseIntelMKL=Yes" + "/p:UseInteloneMKL=No" + ) + else() + list(APPEND BUILD_ARGS + "/p:PlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=No" + "/p:UseInteloneMKL=No" + ) + endif() set(PARALLEL_ARG "/m") elseif(_VCPKG_CMAKE_GENERATOR MATCHES "NMake") # No options are currently added for nmake builds diff --git a/scripts/cmake/vcpkg_build_msbuild.cmake b/scripts/cmake/vcpkg_build_msbuild.cmake index cfd429da2f26aa..ca9462a7f3b06a 100644 --- a/scripts/cmake/vcpkg_build_msbuild.cmake +++ b/scripts/cmake/vcpkg_build_msbuild.cmake @@ -65,7 +65,7 @@ function(vcpkg_build_msbuild) cmake_parse_arguments( _csc "USE_VCPKG_INTEGRATION" - "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" + "PROJECT_PATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;VS_PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN} ) @@ -82,6 +82,9 @@ function(vcpkg_build_msbuild) if(NOT DEFINED _csc_PLATFORM_TOOLSET) set(_csc_PLATFORM_TOOLSET ${VCPKG_PLATFORM_TOOLSET}) endif() + if(NOT DEFINED _csc_VS_PLATFORM_TOOLSET) + set(_csc_VS_PLATFORM_TOOLSET ${VS_PLATFORM_TOOLSET}) + endif() if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION) vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION) endif() @@ -92,13 +95,43 @@ function(vcpkg_build_msbuild) list(APPEND _csc_OPTIONS /t:${_csc_TARGET} /p:Platform=${_csc_PLATFORM} - /p:PlatformToolset=${_csc_PLATFORM_TOOLSET} + /p:PreferredToolArchitecture=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true - /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:TargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /verbosity:n ##q[uiet], m[inimal], n[ormal], d[etailed] e diag[nostic] + /nologo + /p:VcpkgTriplet=${TARGET_TRIPLET} + "/p:UseInteloneMKL=No" /m ) + if(VS_PLATFORM_TOOLSET MATCHES "Clang") + list(APPEND _csc_OPTIONS + "/p:BasePlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:PlatformToolset=${VS_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=No" + "/p:UseClangCl=true" + "/p:UseLldLink=true" + "/p:UseLlvmLib=false" + "/p:TrackFileAccess=false" + "/p:LibToolExe=lib.exe" + "/p:ClangClAdditionalOptions=-Wno-gcc-compat -Xclang -fopenmp -Xclang -flto=thin -Wextra -Wno-unused-variable -verbose" + "/p:LldLinkAdditionalOptions=-debug -force:multipleres -fuse-ld=lld-link -lib" + ) + elseif(VS_PLATFORM_TOOLSET MATCHES "Intel") + list(APPEND _csc_OPTIONS + "/p:BasePlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:PlatformToolset=${VS_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=Yes" + ) + else() + list(APPEND _csc_OPTIONS + "/p:PlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=No" + ) + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions # TODO: Add a way for the user to override this if they want to opt-in to incompatibility @@ -106,10 +139,9 @@ function(vcpkg_build_msbuild) endif() if(_csc_USE_VCPKG_INTEGRATION) - list( - APPEND _csc_OPTIONS - /p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets - "/p:VcpkgTriplet=${TARGET_TRIPLET}" + list(APPEND _csc_OPTIONS + "/p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets" + "/p:VcpkgTriplet=${TARGET_TRIPLET}" ) endif() diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index ab65a5683bc1ca..6ded4b8c000eb6 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -239,9 +239,14 @@ function(vcpkg_configure_cmake) ) if(DEFINED ARCH) - list(APPEND _csc_OPTIONS - "-A${ARCH}" - ) + list(APPEND _csc_OPTIONS -A ${ARCH}) + endif() + + if(NOT DEFINED PREFER_NINJA AND DEFINED VS_PLATFORM_TOOLSET) + list(APPEND _csc_OPTIONS -T ${VS_PLATFORM_TOOLSET}) + set(NINJA_CAN_BE_USED OFF) + else() + set(NINJA_CAN_BE_USED ON) endif() # Sets configuration variables for macOS builds diff --git a/scripts/cmake/vcpkg_install_msbuild.cmake b/scripts/cmake/vcpkg_install_msbuild.cmake index db2874a9ffd273..38ee832857983e 100644 --- a/scripts/cmake/vcpkg_install_msbuild.cmake +++ b/scripts/cmake/vcpkg_install_msbuild.cmake @@ -95,7 +95,7 @@ function(vcpkg_install_msbuild) cmake_parse_arguments( _csc "USE_VCPKG_INTEGRATION;ALLOW_ROOT_INCLUDES;REMOVE_ROOT_INCLUDES;SKIP_CLEAN" - "SOURCE_PATH;PROJECT_SUBPATH;INCLUDES_SUBPATH;LICENSE_SUBPATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" + "SOURCE_PATH;PROJECT_SUBPATH;INCLUDES_SUBPATH;LICENSE_SUBPATH;RELEASE_CONFIGURATION;DEBUG_CONFIGURATION;PLATFORM;PLATFORM_TOOLSET;VS_PLATFORM_TOOLSET;TARGET_PLATFORM_VERSION;TARGET" "OPTIONS;OPTIONS_RELEASE;OPTIONS_DEBUG" ${ARGN} ) @@ -122,6 +122,9 @@ function(vcpkg_install_msbuild) if(NOT DEFINED _csc_PLATFORM_TOOLSET) set(_csc_PLATFORM_TOOLSET ${VCPKG_PLATFORM_TOOLSET}) endif() + if(NOT DEFINED _csc_VS_PLATFORM_TOOLSET) + set(_csc_VS_PLATFORM_TOOLSET ${VS_PLATFORM_TOOLSET}) + endif() if(NOT DEFINED _csc_TARGET_PLATFORM_VERSION) vcpkg_get_windows_sdk(_csc_TARGET_PLATFORM_VERSION) endif() @@ -132,13 +135,43 @@ function(vcpkg_install_msbuild) list(APPEND _csc_OPTIONS /t:${_csc_TARGET} /p:Platform=${_csc_PLATFORM} - /p:PlatformToolset=${_csc_PLATFORM_TOOLSET} + /p:PreferredToolArchitecture=${_csc_PLATFORM} /p:VCPkgLocalAppDataDisabled=true - /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /p:TargetPlatformVersion=${_csc_TARGET_PLATFORM_VERSION} + /verbosity:n ##q[uiet], m[inimal], n[ormal], d[etailed] e diag[nostic] + /nologo + /p:VcpkgTriplet=${TARGET_TRIPLET} + "/p:UseInteloneMKL=No" /m ) + if(VS_PLATFORM_TOOLSET MATCHES "Clang") + list(APPEND _csc_OPTIONS + "/p:BasePlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:PlatformToolset=${VS_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=No" + "/p:UseClangCl=true" + "/p:UseLldLink=true" + "/p:UseLlvmLib=false" + "/p:TrackFileAccess=false" + "/p:LibToolExe=lib.exe" + "/p:ClangClAdditionalOptions=-Wno-gcc-compat -Xclang -fopenmp -Xclang -flto=thin -Wextra -Wno-unused-variable -verbose" + "/p:LldLinkAdditionalOptions=-debug -force:multipleres -fuse-ld=lld-link -lib" + ) + elseif(VS_PLATFORM_TOOLSET MATCHES "Intel") + list(APPEND _csc_OPTIONS + "/p:BasePlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:PlatformToolset=${VS_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=Yes" + ) + else() + list(APPEND _csc_OPTIONS + "/p:PlatformToolset=${VCPKG_PLATFORM_TOOLSET}" + "/p:UseIntelMKL=No" + ) + endif() + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") # Disable LTCG for static libraries because this setting introduces ABI incompatibility between minor compiler versions # TODO: Add a way for the user to override this if they want to opt-in to incompatibility @@ -146,7 +179,11 @@ function(vcpkg_install_msbuild) endif() if(_csc_USE_VCPKG_INTEGRATION) - list(APPEND _csc_OPTIONS /p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets /p:VcpkgApplocalDeps=false) + list(APPEND _csc_OPTIONS + "/p:ForceImportBeforeCppTargets=${SCRIPTS}/buildsystems/msbuild/vcpkg.targets" + "/p:VcpkgApplocalDeps=false" + "/p:VcpkgTriplet=${TARGET_TRIPLET}" + ) endif() get_filename_component(SOURCE_PATH_SUFFIX "${_csc_SOURCE_PATH}" NAME) diff --git a/scripts/toolchains/windows.cmake b/scripts/toolchains/windows.cmake index 43e6d2c2d9a005..04119b8c87c887 100644 --- a/scripts/toolchains/windows.cmake +++ b/scripts/toolchains/windows.cmake @@ -13,6 +13,15 @@ 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(NOT DEFINED VS_PLATFORM_TOOLSET) + set(CMAKE_VS_PLATFORM_TOOLSET ${VS_PLATFORM_TOOLSET}) + endif() + if(VS_PLATFORM_TOOLSET STREQUAL "[Cc][lL][aA][nN][gG][Cc][Ll]" OR VS_PLATFORM_TOOLSET STREQUAL "^[Ll][Ll][Vv][Mm]$" OR VS_PLATFORM_TOOLSET STREQUAL "v[0-9]+_clang_.*") + set(CMAKE_COMPILER_IS_CLANG 1) + elseif(VS_PLATFORM_TOOLSET MATCHES "Intel") + set(CMAKE_COMPILER_IS_INTEL 1) + endif() + set(CHARSET_FLAG "/utf-8") if (NOT VCPKG_SET_CHARSET_FLAG OR VCPKG_PLATFORM_TOOLSET MATCHES "v120") # VS 2013 does not support /utf-8 diff --git a/triplets/x64-windows-clang.cmake b/triplets/x64-windows-clang.cmake new file mode 100644 index 00000000000000..a8d2f93aa582ae --- /dev/null +++ b/triplets/x64-windows-clang.cmake @@ -0,0 +1,13 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VCPKG_PLATFORM_TOOLSET v142) + +set(VS_PLATFORM_TOOLSET "ClangCL,host=x64") +#or +##set(VS_PLATFORM_TOOLSET "LLVM_v142,host=x64" #"v142,cuda=10.1,host=x64" #"v142,host=x64,v=14.16#version=14.11 + +if(DEFINED VS_PLATFORM_TOOLSET) + set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled) +endif() diff --git a/triplets/x64-windows-intel.cmake b/triplets/x64-windows-intel.cmake new file mode 100644 index 00000000000000..bed2b093042155 --- /dev/null +++ b/triplets/x64-windows-intel.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) + +set(VS_PLATFORM_TOOLSET "Intel C++ Compiler 19.1")#example or "Intel C++ Compiler 17.0" + +if(DEFINED VS_PLATFORM_TOOLSET) + set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled) +endif() diff --git a/triplets/x64-windows-static.cmake b/triplets/x64-windows-static.cmake index 75f9b95325ed5b..e905500d27dd32 100644 --- a/triplets/x64-windows-static.cmake +++ b/triplets/x64-windows-static.cmake @@ -1,3 +1,5 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE static) set(VCPKG_LIBRARY_LINKAGE static) + +#set(VCPKG_PLATFORM_TOOLSET v142) diff --git a/triplets/x64-windows.cmake b/triplets/x64-windows.cmake index d0be7297f0c468..befc7e96cb737b 100644 --- a/triplets/x64-windows.cmake +++ b/triplets/x64-windows.cmake @@ -2,3 +2,12 @@ set(VCPKG_TARGET_ARCHITECTURE x64) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE dynamic) +#set(VCPKG_PLATFORM_TOOLSET v142) + +set(VS_PLATFORM_TOOLSET "ClangCL,host=x64") +#or +##set(VS_PLATFORM_TOOLSET "LLVM_v142,host=x64" #"v142,cuda=10.1,host=x64" #"v142,host=x64,v=14.16#version=14.11 + +if(DEFINED VS_PLATFORM_TOOLSET) + set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled) +endif() diff --git a/triplets/x86-windows.cmake b/triplets/x86-windows.cmake index 40ccbe152dc10c..3d479efb29e90e 100644 --- a/triplets/x86-windows.cmake +++ b/triplets/x86-windows.cmake @@ -1,3 +1,5 @@ set(VCPKG_TARGET_ARCHITECTURE x86) set(VCPKG_CRT_LINKAGE dynamic) set(VCPKG_LIBRARY_LINKAGE dynamic) + +#set(VCPKG_PLATFORM_TOOLSET v142)