Browse Source

Drop building on a 32-bit Windows, only generate

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1408/head
Dimitar Dobrev 5 years ago
parent
commit
e7cedb3f3a
  1. 20
      appveyor.yml
  2. 1
      build/Tests.lua
  3. 2
      build/premake5.lua
  4. 14
      build/scripts/LLVM.lua
  5. 3
      src/Parser/ParserOptions.cs
  6. 1
      src/Parser/premake5.lua

20
appveyor.yml

@ -24,7 +24,6 @@ matrix:
os: Visual Studio 2019 os: Visual Studio 2019
platform: platform:
- x86
- x64 - x64
configuration: configuration:
@ -35,8 +34,8 @@ environment:
DEPS_PATH: '%APPVEYOR_BUILD_FOLDER%\deps' DEPS_PATH: '%APPVEYOR_BUILD_FOLDER%\deps'
LLVM_PATH: '%APPVEYOR_BUILD_FOLDER%\deps\llvm' LLVM_PATH: '%APPVEYOR_BUILD_FOLDER%\deps\llvm'
BUILD_PATH: '%APPVEYOR_BUILD_FOLDER%\build\vs%VS_VERSION%' BUILD_PATH: '%APPVEYOR_BUILD_FOLDER%\build\vs%VS_VERSION%'
LIB_PATH: '%APPVEYOR_BUILD_FOLDER%\build\vs%VS_VERSION%\lib\%CONFIGURATION%_%PLATFORM%' LIB_PATH: '%APPVEYOR_BUILD_FOLDER%\build\vs%VS_VERSION%\lib\%CONFIGURATION%_x64'
ARTIFACT_NAME: '%APPVEYOR_PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-vs%VS_VERSION%-%PLATFORM%.zip' ARTIFACT_NAME: '%APPVEYOR_PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-vs%VS_VERSION%.zip'
GITHUB_ACCESS_TOKEN: GITHUB_ACCESS_TOKEN:
secure: CrxPDgxTKC9ZRvFjttpRPO+e1DT8s0Zkk9HrAmHOIzDkOfFbbu1iTm/yJjZ2eDcd secure: CrxPDgxTKC9ZRvFjttpRPO+e1DT8s0Zkk9HrAmHOIzDkOfFbbu1iTm/yJjZ2eDcd
@ -44,12 +43,21 @@ init:
- git config --global core.autocrlf true - git config --global core.autocrlf true
install: install:
- call "C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM% - call "C:\Program Files (x86)\Microsoft Visual Studio\%VS_VERSION%\Community\Common7\Tools\VsDevCmd.bat"
- build\premake5.exe --file=build\scripts\LLVM.lua download_llvm --arch=%PLATFORM% - build\premake5.exe --file=build\scripts\LLVM.lua download_llvm
build_script: build_script:
- build\premake5.exe --file=build\premake5.lua vs%VS_VERSION% --arch=%PLATFORM% - build\premake5.exe --file=build\premake5.lua vs%VS_VERSION% --arch=x86
- msbuild %BUILD_PATH%\CppSharp.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal - msbuild %BUILD_PATH%\CppSharp.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal
- nunit3-console %LIB_PATH%\CLI.Tests.CLI.dll %LIB_PATH%\Common.Tests.CLI.dll %LIB_PATH%\Common.Tests.CSharp.dll %LIB_PATH%\CppSharp.Generator.Tests.dll %LIB_PATH%\CSharp.Tests.CSharp.dll %LIB_PATH%\Encodings.Tests.CSharp.dll %LIB_PATH%\NamespacesDerived.Tests.CSharp.dll %LIB_PATH%\StandardLib.Tests.CLI.dll %LIB_PATH%\VTables.Tests.CSharp.dll --result=myresults.xml;format=AppVeyor
- build\premake5.exe --file=build\premake5.lua vs%VS_VERSION% --arch=x64
- msbuild %BUILD_PATH%\CppSharp.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /verbosity:minimal
- nunit3-console %LIB_PATH%\CLI.Tests.CLI.dll %LIB_PATH%\Common.Tests.CLI.dll %LIB_PATH%\Common.Tests.CSharp.dll %LIB_PATH%\CppSharp.Generator.Tests.dll %LIB_PATH%\CSharp.Tests.CSharp.dll %LIB_PATH%\Encodings.Tests.CSharp.dll %LIB_PATH%\NamespacesDerived.Tests.CSharp.dll %LIB_PATH%\StandardLib.Tests.CLI.dll %LIB_PATH%\VTables.Tests.CSharp.dll --result=myresults.xml;format=AppVeyor
test:
assemblies:
except:
- '*.dll'
#---------------------------------# #---------------------------------#
# parser bindings generation # # parser bindings generation #

1
build/Tests.lua

@ -116,6 +116,7 @@ function SetupTestNativeProject(name, depends)
kind "SharedLib" kind "SharedLib"
language "C++" language "C++"
platforms { target_architecture() }
files { "**.h", "**.cpp" } files { "**.h", "**.cpp" }
vpaths { ["*"] = "*" } vpaths { ["*"] = "*" }
defines { "DLL_EXPORT" } defines { "DLL_EXPORT" }

2
build/premake5.lua

@ -10,7 +10,7 @@ include "LLVM.lua"
workspace "CppSharp" workspace "CppSharp"
configurations { "Debug", "Release" } configurations { "Debug", "Release" }
platforms { target_architecture() } platforms { "x64" }
characterset "Unicode" characterset "Unicode"
symbols "On" symbols "On"

14
build/scripts/LLVM.lua

@ -68,11 +68,7 @@ function get_vs_version()
return map_msvc_to_vs_version(major, minor) return map_msvc_to_vs_version(major, minor)
end end
function get_toolset_configuration_name(arch) function get_toolset_configuration_name()
if not arch then
arch = target_architecture()
end
if os.istarget("windows") then if os.istarget("windows") then
local vsver = _ACTION local vsver = _ACTION
@ -80,15 +76,15 @@ function get_toolset_configuration_name(arch)
vsver = get_vs_version() vsver = get_vs_version()
end end
return table.concat({vsver, arch}, "-") return table.concat({vsver, "x64"}, "-")
end end
-- FIXME: Implement for non-Windows platforms -- FIXME: Implement for non-Windows platforms
return table.concat({arch}, "-") return table.concat({"x64"}, "-")
end end
-- Returns a string describing the package configuration. -- Returns a string describing the package configuration.
-- Example: llvm-f79c5c-windows-vs2015-x86-Debug -- Example: llvm-f79c5c-windows-vs2015-x86-Debug
function get_llvm_package_name(rev, conf, arch) function get_llvm_package_name(rev, conf)
if not rev then if not rev then
rev = get_llvm_rev() rev = get_llvm_rev()
end end
@ -96,7 +92,7 @@ function get_llvm_package_name(rev, conf, arch)
local components = {"llvm", rev, os.target()} local components = {"llvm", rev, os.target()}
local toolset = get_toolset_configuration_name(arch) local toolset = get_toolset_configuration_name()
table.insert(components, toolset) table.insert(components, toolset)
if os.istarget("linux") then if os.istarget("linux") then

3
src/Parser/ParserOptions.cs

@ -137,6 +137,9 @@ namespace CppSharp.Parser
/// <param name="vsVersion">The version of Visual Studio to look for.</param> /// <param name="vsVersion">The version of Visual Studio to look for.</param>
public void SetupMSVC(VisualStudioVersion vsVersion) public void SetupMSVC(VisualStudioVersion vsVersion)
{ {
if (BuildConfig.Arch == "x86")
TargetTriple = "i686-pc-windows-msvc";
MicrosoftMode = true; MicrosoftMode = true;
var clVersion = MSVCToolchain.GetCLVersion(vsVersion); var clVersion = MSVCToolchain.GetCLVersion(vsVersion);

1
src/Parser/premake5.lua

@ -7,6 +7,7 @@ local function GenerateBuildConfig()
file:write("namespace CppSharp.Parser", "\n{\n ") file:write("namespace CppSharp.Parser", "\n{\n ")
file:write("public static class BuildConfig", "\n {\n ") file:write("public static class BuildConfig", "\n {\n ")
file:write("public const string Choice = \"" .. _ACTION .. "\";\n") file:write("public const string Choice = \"" .. _ACTION .. "\";\n")
file:write("public const string Arch = \"" .. _OPTIONS["arch"] .. "\";\n")
file:write(" }\n}") file:write(" }\n}")
file:close() file:close()
end end

Loading…
Cancel
Save