mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 02:51:55 +00:00
Merge pull request #3822 from giggsoff/allow_build_without_cgo
Allow build for darwin without CGO
This commit is contained in:
commit
86cc42bf79
@ -9,6 +9,7 @@ with updated versions of both.
|
|||||||
|
|
||||||
Alternatively, you can install Virtualization.Framework and VPNKit standalone and use it without Docker for Mac.
|
Alternatively, you can install Virtualization.Framework and VPNKit standalone and use it without Docker for Mac.
|
||||||
|
|
||||||
|
Virtualization.Framework is enabled on macOS only when built with CGO enabled.
|
||||||
|
|
||||||
## Boot
|
## Boot
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ ifeq ($(STATIC), 1)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# darwin needs CGO to build for virtualization framework
|
# darwin needs CGO to build for virtualization framework
|
||||||
|
# without CGO attempt to use virtualization framework will ends with error
|
||||||
ifeq ($(GOOS), darwin)
|
ifeq ($(GOOS), darwin)
|
||||||
CGO_ENABLED=1
|
CGO_ENABLED=1
|
||||||
endif
|
endif
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
//go:build darwin && !cgo
|
||||||
|
// +build darwin,!cgo
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Process the run arguments and execute run
|
||||||
|
func runVirtualizationFramework(args []string) {
|
||||||
|
log.Fatal("This build of linuxkit was compiled without virtualization framework capabilities. " +
|
||||||
|
"To perform 'linuxkit run' on macOS, please use a version of linuxkit compiled with virtualization framework.")
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
//go:build darwin
|
//go:build darwin && cgo
|
||||||
// +build darwin
|
// +build darwin,cgo
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
Loading…
Reference in New Issue
Block a user