Fix using curl lib on Linux (use self compiled static lib)
This commit is contained in:
2
.github/workflows/build_linux.yml
vendored
2
.github/workflows/build_linux.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext curl libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libcurl4
|
||||
sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev build-essential gettext libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout LFS
|
||||
|
||||
@@ -47,7 +47,7 @@ Flax Visual Studio extension provides better programming workflow, C# scripts de
|
||||
* Install Visual Studio Code
|
||||
* Install Mono ([https://www.mono-project.com/download/stable](https://www.mono-project.com/download/stable))
|
||||
* Install Git with LFS
|
||||
* Install requried packages: `sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev nuget autoconf libogg-dev automake build-essential gettext cmake python curl libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev libcurl4`
|
||||
* Install requried packages: `sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev nuget autoconf libogg-dev automake build-essential gettext cmake python libtool libtool-bin libpulse-dev libasound2-dev libjack-dev portaudio19-dev`
|
||||
* Install compiler `sudo apt-get install clang lldb lld` (Clang 6 or newer)
|
||||
* Clone repo (with LFS)
|
||||
* Run `./GenerateProjectFiles.sh`
|
||||
|
||||
BIN
Source/Platforms/Linux/Binaries/ThirdParty/x64/libcurl.a
(Stored with Git LFS)
vendored
Normal file
BIN
Source/Platforms/Linux/Binaries/ThirdParty/x64/libcurl.a
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
2
Source/ThirdParty/curl/curl.Build.cs
vendored
2
Source/ThirdParty/curl/curl.Build.cs
vendored
@@ -38,7 +38,7 @@ public class curl : DepsModule
|
||||
options.OutputFiles.Add("crypt32.lib");
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
options.Libraries.Add("curl");
|
||||
options.OutputFiles.Add(Path.Combine(depsRoot, "libcurl.a"));
|
||||
break;
|
||||
default: throw new InvalidPlatformException(options.Platform.Target);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
@@ -25,6 +26,11 @@ namespace Flax.Deps.Dependencies
|
||||
{
|
||||
TargetPlatform.Windows,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetPlatform.Linux,
|
||||
};
|
||||
default: return new TargetPlatform[0];
|
||||
}
|
||||
}
|
||||
@@ -76,7 +82,37 @@ namespace Flax.Deps.Dependencies
|
||||
foreach (var filename in binariesToCopyWin)
|
||||
Utilities.FileCopy(Path.Combine(root, "build", "Win64", vcVersion, configuration, filename), Path.Combine(depsFolder, Path.GetFileName(filename)));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
// Build for Linux
|
||||
var settings = new []
|
||||
{
|
||||
"-without-librtmp",
|
||||
"--without-ssl",
|
||||
"--with-gnutls",
|
||||
"--disable-ipv6",
|
||||
"--disable-manual",
|
||||
"--disable-verbose",
|
||||
"--disable-shared",
|
||||
"--enable-static",
|
||||
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-7" },
|
||||
{ "CC_FOR_BUILD", "clang-7" }
|
||||
};
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
SetupDirectory(buildDir, true);
|
||||
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.None);
|
||||
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.None, envVars);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.None);
|
||||
Utilities.Run("make", "install", null, root, Utilities.RunOptions.None);
|
||||
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Linux, TargetArchitecture.x64);
|
||||
var filename = "libcurl.a";
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user