core icon indicating copy to clipboard operation
core copied to clipboard

Add support for cross compiling apps

Open kkoreilly opened this issue 1 year ago • 1 comments

Discussed in https://github.com/cogentcore/core/discussions/1105

Originally posted by Klaus-Tockloth August 2, 2024 The cross-compilation (darwin/arm64 -> windows/amd64) of a minimal 'Hello World' program fails. Unfortunately, I could not find any further documentation on the subject of 'cross-compiling'.

Output from 'go build':

# compile 'windows'
env GOOS=windows GOARCH=amd64 go build -o build/windows-amd64/hello.exe
# github.com/goki/vulkan
vendor/github.com/goki/vulkan/errors.go:8:19: undefined: Result
vendor/github.com/goki/vulkan/vk_null64.go:12:16: undefined: Semaphore
...
vendor/github.com/goki/vulkan/vk_null64.go:28:16: too many errors

Output from 'core build':

% core build -verbose -about 'Hello World for windows/amd64' -target windows/amd64
go build -ldflags -s -w -X 'cogentcore.org/core/core.AppAbout=Hello World for windows/amd64' -X cogentcore.org/core/system.CoreVersion=v0.3.0 -o /Users/klaustockloth/go/src/klaus/cogent-core/hello/Hello.exe
# github.com/goki/vulkan
vendor/github.com/goki/vulkan/errors.go:8:19: undefined: Result
vendor/github.com/goki/vulkan/vk_null64.go:12:16: undefined: Semaphore
vendor/github.com/goki/vulkan/vk_null64.go:14:12: undefined: Fence
...
vendor/github.com/goki/vulkan/vk_null64.go:28:16: too many errors
core build failed: build: error building for platform windows/amd64: failed to run "go build -ldflags -s -w -X 'cogentcore.org/core/core.AppAbout=Hello World for windows/amd64' -X cogentcore.org/core/system.CoreVersion=v0.3.0 -o /Users/klaustockloth/go/src/klaus/cogent-core/hello/Hello.exe: exit status 1"

I'm probably missing something ...

kkoreilly avatar Aug 02 '24 18:08 kkoreilly

See also #1409.

kkoreilly avatar Jan 05 '25 06:01 kkoreilly