From 13144d11c1520c0c863b5b2879c48534f861965f Mon Sep 17 00:00:00 2001 From: Niyas Sait Date: Wed, 17 Nov 2021 23:43:23 +0000 Subject: [PATCH] Enable building win/arm64 package using visual studio (#1130) * Retarget Visual studio tool chain to v142 * add ARM64 option to wintest.bat * add windows/arm64 target to appveyor for CI * add arm64 targets to visual studio solutions * add cross compile option to wintest.bat * Fix missing SET in wintest.bat * update auto-generation scripts for msvc and update project files --- appveyor.yml | 6 +- builds/Makefile.am | 1 + builds/msvc/build/buildbase.bat | 25 +++ builds/msvc/properties/ARM64.props | 18 ++ builds/msvc/vs2019/libsodium.sln | 18 ++ .../msvc/vs2019/libsodium/libsodium.vcxproj | 70 ++++--- libsodium.sln | 19 +- libsodium.vcxproj | 173 +++++++++++++++++- libsodium.vcxproj.filters | 10 +- regen-msvc/libsodium.vcxproj.tpl | 49 +---- regen-msvc/regen-msvc.py | 20 ++ test/default/wintest.bat | 17 +- 12 files changed, 336 insertions(+), 90 deletions(-) create mode 100644 builds/msvc/properties/ARM64.props diff --git a/appveyor.yml b/appveyor.yml index 5fdcdc8a..bc140d3b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: 1.0.18.{build} -os: Visual Studio 2017 +os: Visual Studio 2019 environment: matrix: @@ -12,6 +12,10 @@ environment: configuration: Debug - platform: x64 configuration: Release + - platform: ARM64 + configuration: Debug + - platform: ARM64 + configuration: Release matrix: fast_finish: false diff --git a/builds/Makefile.am b/builds/Makefile.am index 23dfe9d2..25835423 100644 --- a/builds/Makefile.am +++ b/builds/Makefile.am @@ -25,6 +25,7 @@ EXTRA_DIST = \ msvc/properties/ReleaseSEXE.props \ msvc/properties/Win32.props \ msvc/properties/x64.props \ + msvc/properties/ARM64.props \ msvc/resource.h \ msvc/resource.rc \ msvc/version.h \ diff --git a/builds/msvc/build/buildbase.bat b/builds/msvc/build/buildbase.bat index 93352732..d65a876a 100644 --- a/builds/msvc/build/buildbase.bat +++ b/builds/msvc/build/buildbase.bat @@ -93,6 +93,31 @@ ECHO Configuration=StaticRelease msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=x64 %solution% >> %log% IF errorlevel 1 GOTO error +@REM Build ARM64 packages only for Visual studio 19 and later +IF %version% == 16 ( + CALL !environment! x86_arm64 > nul + ECHO Platform=ARM64 + + ECHO Configuration=DynDebug + msbuild /m /v:n /p:Configuration=DynDebug /p:Platform=ARM64 %solution% >> %log% + IF errorlevel 1 GOTO error + ECHO Configuration=DynRelease + msbuild /m /v:n /p:Configuration=DynRelease /p:Platform=ARM64 %solution% >> %log% + IF errorlevel 1 GOTO error + ECHO Configuration=LtcgDebug + msbuild /m /v:n /p:Configuration=LtcgDebug /p:Platform=ARM64 %solution% >> %log% + IF errorlevel 1 GOTO error + ECHO Configuration=LtcgRelease + msbuild /m /v:n /p:Configuration=LtcgRelease /p:Platform=ARM64 %solution% >> %log% + IF errorlevel 1 GOTO error + ECHO Configuration=StaticDebug + msbuild /m /v:n /p:Configuration=StaticDebug /p:Platform=ARM64 %solution% >> %log% + IF errorlevel 1 GOTO error + ECHO Configuration=StaticRelease + msbuild /m /v:n /p:Configuration=StaticRelease /p:Platform=ARM64 %solution% >> %log% + IF errorlevel 1 GOTO error +) + ECHO Complete: %solution% GOTO end diff --git a/builds/msvc/properties/ARM64.props b/builds/msvc/properties/ARM64.props new file mode 100644 index 00000000..34b58ae4 --- /dev/null +++ b/builds/msvc/properties/ARM64.props @@ -0,0 +1,18 @@ + + + + <_PropertySheetDisplayName>ARM64 Settings + + + + WIN32;_WIN32;%(PreprocessorDefinitions) + + + MachineARM64 + + + /MACHINE:ARM64 %(AdditionalOptions) + + + + diff --git a/builds/msvc/vs2019/libsodium.sln b/builds/msvc/vs2019/libsodium.sln index 0f3f7306..43296cb0 100644 --- a/builds/msvc/vs2019/libsodium.sln +++ b/builds/msvc/vs2019/libsodium.sln @@ -9,42 +9,60 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution DynDebug|Win32 = DynDebug|Win32 DynDebug|x64 = DynDebug|x64 + DynDebug|ARM64 = DynDebug|ARM64 DynRelease|Win32 = DynRelease|Win32 DynRelease|x64 = DynRelease|x64 + DynRelease|ARM64 = DynRelease|ARM64 LtcgDebug|Win32 = LtcgDebug|Win32 LtcgDebug|x64 = LtcgDebug|x64 + LtcgDebug|ARM64 = LtcgDebug|ARM64 LtcgRelease|Win32 = LtcgRelease|Win32 LtcgRelease|x64 = LtcgRelease|x64 + LtcgRelease|ARM64 = LtcgRelease|ARM64 StaticDebug|Win32 = StaticDebug|Win32 StaticDebug|x64 = StaticDebug|x64 + StaticDebug|ARM64 = StaticDebug|ARM64 StaticRelease|Win32 = StaticRelease|Win32 StaticRelease|x64 = StaticRelease|x64 + StaticRelease|ARM64 = StaticRelease|ARM64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|Win32.ActiveCfg = DebugDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|Win32.Build.0 = DebugDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|x64.ActiveCfg = DebugDLL|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|x64.Build.0 = DebugDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|ARM64.ActiveCfg = DebugDLL|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynDebug|ARM64.Build.0 = DebugDLL|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|Win32.ActiveCfg = ReleaseDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|Win32.Build.0 = ReleaseDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|x64.ActiveCfg = ReleaseDLL|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|x64.Build.0 = ReleaseDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|ARM64.ActiveCfg = ReleaseDLL|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DynRelease|ARM64.Build.0 = ReleaseDLL|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|Win32.ActiveCfg = DebugLTCG|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|Win32.Build.0 = DebugLTCG|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|x64.ActiveCfg = DebugLTCG|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|x64.Build.0 = DebugLTCG|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|ARM64.ActiveCfg = DebugLTCG|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgDebug|ARM64.Build.0 = DebugLTCG|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|Win32.ActiveCfg = ReleaseLTCG|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|Win32.Build.0 = ReleaseLTCG|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|x64.ActiveCfg = ReleaseLTCG|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|x64.Build.0 = ReleaseLTCG|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|ARM64.ActiveCfg = ReleaseLTCG|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.LtcgRelease|ARM64.Build.0 = ReleaseLTCG|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|Win32.ActiveCfg = DebugLIB|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|Win32.Build.0 = DebugLIB|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|x64.ActiveCfg = DebugLIB|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|x64.Build.0 = DebugLIB|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|ARM64.ActiveCfg = DebugLIB|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticDebug|ARM64.Build.0 = DebugLIB|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|Win32.ActiveCfg = ReleaseLIB|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|Win32.Build.0 = ReleaseLIB|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|x64.ActiveCfg = ReleaseLIB|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|x64.Build.0 = ReleaseLIB|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|ARM64.ActiveCfg = ReleaseLIB|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.StaticRelease|ARM64.Build.0 = ReleaseLIB|ARM64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/builds/msvc/vs2019/libsodium/libsodium.vcxproj b/builds/msvc/vs2019/libsodium/libsodium.vcxproj index 6d060bc5..519d448e 100644 --- a/builds/msvc/vs2019/libsodium/libsodium.vcxproj +++ b/builds/msvc/vs2019/libsodium/libsodium.vcxproj @@ -10,50 +10,74 @@ DebugDLL Win32 - - ReleaseDLL - Win32 - DebugDLL x64 + + DebugDLL + ARM64 + + + ReleaseDLL + Win32 + ReleaseDLL x64 - - DebugLTCG - Win32 - - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG - x64 + + ReleaseDLL + ARM64 DebugLIB Win32 - - ReleaseLIB - Win32 - DebugLIB x64 + + DebugLIB + ARM64 + + + ReleaseLIB + Win32 + ReleaseLIB x64 + + ReleaseLIB + ARM64 + + + DebugLTCG + Win32 + + + DebugLTCG + x64 + + + DebugLTCG + ARM64 + + + ReleaseLTCG + Win32 + + + ReleaseLTCG + x64 + + + ReleaseLTCG + ARM64 + StaticLibrary diff --git a/libsodium.sln b/libsodium.sln index f5808c66..500f7d94 100644 --- a/libsodium.sln +++ b/libsodium.sln @@ -1,34 +1,46 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.23107.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31424.327 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "libsodium.vcxproj", "{A185B162-6CB6-4502-B03F-B56F7699A8D9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM64 = Debug|ARM64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 + DebugDLL|ARM64 = DebugDLL|ARM64 DebugDLL|Win32 = DebugDLL|Win32 DebugDLL|x64 = DebugDLL|x64 + Release|ARM64 = Release|ARM64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 + ReleaseDLL|ARM64 = ReleaseDLL|ARM64 ReleaseDLL|Win32 = ReleaseDLL|Win32 ReleaseDLL|x64 = ReleaseDLL|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|ARM64.Build.0 = Debug|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|Win32.ActiveCfg = Debug|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|Win32.Build.0 = Debug|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x64.ActiveCfg = Debug|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Debug|x64.Build.0 = Debug|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|ARM64.ActiveCfg = DebugDLL|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|ARM64.Build.0 = DebugDLL|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|Win32.Build.0 = DebugDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.DebugDLL|x64.Build.0 = DebugDLL|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|ARM64.ActiveCfg = Release|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|ARM64.Build.0 = Release|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|Win32.ActiveCfg = Release|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|Win32.Build.0 = Release|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x64.ActiveCfg = Release|x64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.Release|x64.Build.0 = Release|x64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|ARM64.ActiveCfg = ReleaseDLL|ARM64 + {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|ARM64.Build.0 = ReleaseDLL|ARM64 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32 {A185B162-6CB6-4502-B03F-B56F7699A8D9}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 @@ -37,4 +49,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5A6485EC-81D2-4E84-80BE-2D82A65D901C} + EndGlobalSection EndGlobal diff --git a/libsodium.vcxproj b/libsodium.vcxproj index 500f518a..fb20266c 100644 --- a/libsodium.vcxproj +++ b/libsodium.vcxproj @@ -1,6 +1,10 @@  + + DebugDLL + ARM64 + DebugDLL Win32 @@ -9,6 +13,10 @@ DebugDLL x64 + + Debug + ARM64 + Debug Win32 @@ -17,6 +25,10 @@ Debug x64 + + ReleaseDLL + ARM64 + ReleaseDLL Win32 @@ -25,6 +37,10 @@ ReleaseDLL x64 + + Release + ARM64 + Release Win32 @@ -38,6 +54,7 @@ {A185B162-6CB6-4502-B03F-B56F7699A8D9} Win32Proj libsodium + 10.0 @@ -45,56 +62,84 @@ true MultiByte false - v140 + v142 + + + StaticLibrary + true + MultiByte + false + v142 DynamicLibrary true MultiByte false - v140 + v142 + + + DynamicLibrary + true + MultiByte + false + v142 StaticLibrary true MultiByte false - v140 + v142 DynamicLibrary true MultiByte false - v140 + v142 StaticLibrary false true MultiByte - v140 + v142 + + + StaticLibrary + false + true + MultiByte + v142 DynamicLibrary false true MultiByte - v140 + v142 + + + DynamicLibrary + false + true + MultiByte + v142 StaticLibrary false true MultiByte - v140 + v142 DynamicLibrary false true MultiByte - v140 + v142 @@ -103,10 +148,18 @@ + + + + + + + + @@ -119,10 +172,18 @@ + + + + + + + + @@ -137,11 +198,21 @@ $(SolutionDir)Build\$(Configuration)\$(Platform)\ $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + true $(SolutionDir)Build\$(Configuration)\$(Platform)\ $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + true $(SolutionDir)Build\$(Configuration)\$(Platform)\ @@ -157,11 +228,21 @@ $(SolutionDir)Build\$(Configuration)\$(Platform)\ $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + false $(SolutionDir)Build\$(Configuration)\$(Platform)\ $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + false $(SolutionDir)Build\$(Configuration)\$(Platform)\ @@ -188,6 +269,22 @@ true + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + @@ -204,6 +301,22 @@ true + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + @@ -255,6 +368,27 @@ true + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + Level3 @@ -276,6 +410,27 @@ true + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + Level3 @@ -575,4 +730,4 @@ - + \ No newline at end of file diff --git a/libsodium.vcxproj.filters b/libsodium.vcxproj.filters index 42bef65f..e7cc27ad 100644 --- a/libsodium.vcxproj.filters +++ b/libsodium.vcxproj.filters @@ -764,5 +764,13 @@ Header Files + + Header Files + - + + + Resource Files + + + \ No newline at end of file diff --git a/regen-msvc/libsodium.vcxproj.tpl b/regen-msvc/libsodium.vcxproj.tpl index e8d326c8..a4893049 100644 --- a/regen-msvc/libsodium.vcxproj.tpl +++ b/regen-msvc/libsodium.vcxproj.tpl @@ -6,54 +6,7 @@ {{platform}} - - DebugDLL - Win32 - - - ReleaseDLL - Win32 - - - DebugDLL - x64 - - - ReleaseDLL - x64 - - - DebugLTCG - Win32 - - - ReleaseLTCG - Win32 - - - DebugLTCG - x64 - - - ReleaseLTCG - x64 - - - DebugLIB - Win32 - - - ReleaseLIB - Win32 - - - DebugLIB - x64 - - - ReleaseLIB - x64 - + {{ProjectConfigurations}} StaticLibrary diff --git a/regen-msvc/regen-msvc.py b/regen-msvc/regen-msvc.py index 8b479d82..953d5a61 100755 --- a/regen-msvc/regen-msvc.py +++ b/regen-msvc/regen-msvc.py @@ -76,6 +76,20 @@ for dir in dirs: fd = fd + " {{{}}}\r\n".format(uid) fd = fd + " \r\n" +def get_project_configurations(vs_version): + projconfig = "" + configs = ["DebugDLL", "ReleaseDLL", "DebugLIB", "ReleaseLIB", "DebugLTCG", "ReleaseLTCG"] + platforms = ["Win32", "x64"] + # add arm64 platform only for v142+ toolchain + if vs_version >= 142: + platforms.append("ARM64") + for config in configs: + for platform in platforms: + projconfig = projconfig + ' \r\n'.format(config, platform) + projconfig = projconfig + " {}\r\n".format(config) + projconfig = projconfig + " {}\r\n".format(platform) + projconfig = projconfig + " \r\n" + return projconfig def apply_template(tplfile, outfile, sbox): tpl = "" @@ -155,12 +169,14 @@ apply_template( ) sbox.update({"platform": "v142"}) +sbox.update({"ProjectConfigurations": get_project_configurations(142)}) apply_template( sd + "/libsodium.vcxproj.tpl", "builds/msvc/vs2019/libsodium/libsodium.vcxproj", sbox, ) +sbox.update({"ProjectConfigurations": get_project_configurations(141)}) sbox.update({"platform": "v141"}) apply_template( sd + "/libsodium.vcxproj.tpl", @@ -168,6 +184,7 @@ apply_template( sbox, ) +sbox.update({"ProjectConfigurations": get_project_configurations(140)}) sbox.update({"platform": "v140"}) apply_template( sd + "/libsodium.vcxproj.tpl", @@ -175,6 +192,7 @@ apply_template( sbox, ) +sbox.update({"ProjectConfigurations": get_project_configurations(120)}) sbox.update({"platform": "v120"}) apply_template( sd + "/libsodium.vcxproj.tpl", @@ -182,6 +200,7 @@ apply_template( sbox, ) +sbox.update({"ProjectConfigurations": get_project_configurations(110)}) sbox.update({"platform": "v110"}) apply_template( sd + "/libsodium.vcxproj.tpl", @@ -189,6 +208,7 @@ apply_template( sbox, ) +sbox.update({"ProjectConfigurations": get_project_configurations(100)}) sbox.update({"platform": "v100"}) apply_template( sd + "/libsodium.vcxproj.tpl", diff --git a/test/default/wintest.bat b/test/default/wintest.bat index e50fb494..4a22edad 100755 --- a/test/default/wintest.bat +++ b/test/default/wintest.bat @@ -1,7 +1,7 @@ @ECHO OFF if "%1" == "" ( - echo "Usage: wintest.bat [ ]" goto :END ) @@ -13,7 +13,8 @@ if not exist sodium_version.c ( ) ) -if "%2" == "x64" (SET ARCH=x64) else (SET ARCH=Win32) +if "%2" == "x64" (SET ARCH=x64) else if "%2" == "ARM64" (SET ARCH=ARM64) else (SET ARCH=ARM64) +if "%2" == "ARM64" (SET CROSSCOMPILE=1) else (SET CROSSCOMPILE=0) SET CFLAGS=/nologo /DTEST_SRCDIR=\".\" /I..\..\src\libsodium\include\sodium /I..\..\src\libsodium\include /I..\quirks SET LDFLAGS=/link /LTCG advapi32.lib ..\..\Build\%1\%ARCH%\libsodium.lib if "%1" == "ReleaseDLL" ( goto :ReleaseDLL ) @@ -44,11 +45,15 @@ FOR %%f in (*.c) DO ( echo %%f compile failed goto :END ) - %%f.exe - if errorlevel 1 ( - echo %%f failed + if %CROSSCOMPILE% == 1 ( + echo %%f skipped ) else ( - echo %%f ok + %%f.exe + if errorlevel 1 ( + echo %%f failed + ) else ( + echo %%f ok + ) ) ) REM Remove temporary files