mirror of
https://onedev.site.tesses.net/crosslang
synced 2026-02-09 01:25:45 +00:00
Push win32
This commit is contained in:
@@ -73,7 +73,7 @@ jobs:
|
|||||||
bash build-ubuntu-jammy.sh
|
bash build-ubuntu-jammy.sh
|
||||||
bash push-ubuntu-jammy.sh
|
bash push-ubuntu-jammy.sh
|
||||||
apt update -y
|
apt update -y
|
||||||
apt install -y crosslang git
|
apt install -y crosslang git gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-i686 g++-mingw-w64-i686
|
||||||
cd ../CPKG
|
cd ../CPKG
|
||||||
bash pack_and_publish.sh
|
bash pack_and_publish.sh
|
||||||
envVars:
|
envVars:
|
||||||
|
|||||||
7
Packaging/CPKG/WindowsToolchains/x64.cmake
Normal file
7
Packaging/CPKG/WindowsToolchains/x64.cmake
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
set(CMAKE_C_COMPILER "/usr/bin/x86_64-w64-mingw32-gcc")
|
||||||
|
set(CMAKE_CXX_COMPILER "/usr/bin/x86_64-w64-mingw32-g++")
|
||||||
|
set(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
set(CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
set(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||||
7
Packaging/CPKG/WindowsToolchains/x86.cmake
Normal file
7
Packaging/CPKG/WindowsToolchains/x86.cmake
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
set(CMAKE_C_COMPILER "/usr/bin/i686-w64-mingw32-gcc")
|
||||||
|
set(CMAKE_CXX_COMPILER "/usr/bin/i686-w64-mingw32-g++")
|
||||||
|
set(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
set(CMAKE_CXX_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
|
||||||
|
set(CMAKE_SYSTEM_NAME Windows)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||||
@@ -42,6 +42,10 @@ var statics = [
|
|||||||
}
|
}
|
||||||
|
|
||||||
];
|
];
|
||||||
|
var winStatics = [
|
||||||
|
"x64",
|
||||||
|
"x86"
|
||||||
|
];
|
||||||
func CPUS()
|
func CPUS()
|
||||||
{
|
{
|
||||||
var p = Process.Start({
|
var p = Process.Start({
|
||||||
@@ -53,6 +57,51 @@ func CPUS()
|
|||||||
return ParseLong(ms.GetBytes().ToString().Replace("\n","").Replace("\r",""));
|
return ParseLong(ms.GetBytes().ToString().Replace("\n","").Replace("\r",""));
|
||||||
}
|
}
|
||||||
var nproc = CPUS();
|
var nproc = CPUS();
|
||||||
|
func BuildConsoleOrServerWindowsStatic(arch)
|
||||||
|
{
|
||||||
|
Console.WriteLine($"Building Windows Static {arch}");
|
||||||
|
var build_dir = "builds" / $"win-{arch}";
|
||||||
|
var publish_dir = "publish" / $"win-{arch}";
|
||||||
|
FS.Local.CreateDirectory(build_dir);
|
||||||
|
FS.Local.CreateDirectory(publish_dir);
|
||||||
|
|
||||||
|
var args = ["-S","ConsoleOrServer","-B",build_dir.ToString(),"-DCROSSAPPPUBLISH_STATIC=ON"];
|
||||||
|
|
||||||
|
args.Add($"-DCMAKE_TOOLCHAIN_FILE=WindowsToolchains/{arch}.cmake");
|
||||||
|
|
||||||
|
Process.Start({
|
||||||
|
FileName = Env.GetRealExecutablePath("cmake").ToString(),
|
||||||
|
Arguments = args
|
||||||
|
}).Join();
|
||||||
|
|
||||||
|
|
||||||
|
var p = new Process();
|
||||||
|
p.FileName = Env.GetRealExecutablePath("make").ToString();
|
||||||
|
p.WorkingDirectory = build_dir.MakeAbsolute().ToString();
|
||||||
|
p.Arguments = [$"-j{nproc}"];
|
||||||
|
if(p.Start())
|
||||||
|
p.Join();
|
||||||
|
|
||||||
|
|
||||||
|
mvFile(build_dir/"crossapp", publish_dir / "crossapp");
|
||||||
|
var info = {
|
||||||
|
type = "archive",
|
||||||
|
maintainer = "Mike Nolan",
|
||||||
|
repo = "https://onedev.site.tesses.net/crosslang",
|
||||||
|
homepage = "https://crosslang.tesseslanguage.com/",
|
||||||
|
executable_name = "crossapp",
|
||||||
|
executable_can_be_renamed = true,
|
||||||
|
executable_runtime = $"win-{arch}",
|
||||||
|
description = $"Runtime files for win-{arch}",
|
||||||
|
};
|
||||||
|
|
||||||
|
var name = $"Tesses.CrossLang.Runtime.win-{arch}";
|
||||||
|
|
||||||
|
var subDir = new SubdirFilesystem(FS.Local,publish_dir);
|
||||||
|
var pkgStrm = FS.Local.OpenFile("publish"/$"{name}-{VERSION}.crvm","wb");
|
||||||
|
FS.CreateArchive(subDir,pkgStrm, name ,VERSION, Json.Encode(info));
|
||||||
|
pkgStrm.Close();
|
||||||
|
}
|
||||||
func BuildConsoleOrServerLinuxStatic(dir,cmake_toolchain)
|
func BuildConsoleOrServerLinuxStatic(dir,cmake_toolchain)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Building Linux Static {dir}");
|
Console.WriteLine($"Building Linux Static {dir}");
|
||||||
@@ -194,6 +243,11 @@ func mvFile(src,dest)
|
|||||||
func main(args)
|
func main(args)
|
||||||
{
|
{
|
||||||
Console.WriteLine($"Got {nproc} cpus");
|
Console.WriteLine($"Got {nproc} cpus");
|
||||||
|
each(var static : winStatics)
|
||||||
|
{
|
||||||
|
BuildConsoleOrServerWindowsStatic(static);
|
||||||
|
}
|
||||||
|
|
||||||
BuildConsoleOrServerLinuxShared("x86_64");
|
BuildConsoleOrServerLinuxShared("x86_64");
|
||||||
BuildConsoleOrServerLinuxShared("aarch64", "/opt/toolchains/arm64.cmake");
|
BuildConsoleOrServerLinuxShared("aarch64", "/opt/toolchains/arm64.cmake");
|
||||||
BuildConsoleOrServerLinuxShared("armv7l", "/opt/toolchains/armhf.cmake");
|
BuildConsoleOrServerLinuxShared("armv7l", "/opt/toolchains/armhf.cmake");
|
||||||
|
|||||||
Reference in New Issue
Block a user