[linux] get compiling working

This commit is contained in:
Lea Anthony
2021-11-13 17:06:48 -08:00
parent 9073caf287
commit ab1469638f
11 changed files with 709 additions and 5 deletions

View File

@@ -295,10 +295,12 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
if options.Platform != "windows" {
// Use upsertEnv so we don't overwrite user's CGO_CFLAGS
cmd.Env = upsertEnv(cmd.Env, "CGO_CFLAGS", func(v string) string {
if v != "" {
v += " "
if options.Platform == "darwin" {
if v != "" {
v += " "
}
v += "-mmacosx-version-min=10.13"
}
v += "-mmacosx-version-min=10.13"
return v
})
// Use upsertEnv so we don't overwrite user's CGO_CXXFLAGS
@@ -313,7 +315,7 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
cmd.Env = upsertEnv(cmd.Env, "CGO_ENABLED", func(v string) string {
return "1"
})
if runtime.GOOS == "darwin" {
if options.Platform == "darwin" {
// Set the minimum Mac SDK to 10.13
cmd.Env = upsertEnv(cmd.Env, "CGO_LDFLAGS", func(v string) string {
if v != "" {

View File

@@ -27,6 +27,8 @@ func packageProject(options *Options, platform string) error {
err = packageApplicationForDarwin(options)
case "windows":
err = packageApplicationForWindows(options)
case "linux":
err = packageApplicationForLinux(options)
default:
err = fmt.Errorf("packing not supported for %s yet", platform)
}
@@ -204,6 +206,29 @@ func packageApplicationForWindows(options *Options) error {
return nil
}
func packageApplicationForLinux(options *Options) error {
// Generate icon
//var err error
//err = generateIcoFile(options)
//if err != nil {
// return err
//}
//
//// Ensure Manifest is present
//err = generateManifest(options)
//if err != nil {
// return err
//}
//
//// Create syso file
//err = compileResources(options)
//if err != nil {
// return err
//}
return nil
}
func generateManifest(options *Options) error {
filename := options.ProjectData.Name + ".exe.manifest"
manifestFile := filepath.Join(options.ProjectData.Path, "build", "windows", filename)