From 0870447e4d7dde8b5d480d6ff67a5c0a491b11f8 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Fri, 3 Aug 2018 08:01:41 -0400 Subject: [PATCH] add cross-compiling docs --- README.md | 14 ++++++++++++++ README_zh.md | 14 ++++++++++++++ cdeps/README.md | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3405dd4..cf4ec5a 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ This is a work in progress. - [Installation](#installation) - [Update](#update) - [Examples](#examples) +- [Cross-compiling](#Cross-compiling) - [Plans](#plans) - [Donate](#donate) - [Contributors](#contributors) @@ -257,6 +258,19 @@ func main() { } ``` +## Cross-compiling + +##### Windows64 to win32 +```Go +SET CGO_ENABLED=1 +SET GOARCH=386 +go build main.go +``` +#### Ohter to windows +```Go +GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -x ./ +``` + ## Plans - Update Find an image on screen, read pixels from an image - Update Window Handle diff --git a/README_zh.md b/README_zh.md index b9800c0..26e7479 100644 --- a/README_zh.md +++ b/README_zh.md @@ -23,6 +23,7 @@ QQ 群: 595877611 - [Installation](#installation) - [Update](#update) - [Examples](#examples) +- [Cross-compiling](#Cross-compiling) - [Plans](#plans) - [Donate](#donate) - [Contributors](#contributors) @@ -254,6 +255,19 @@ func main() { } ``` +## Cross-compiling + +##### Windows64 to win32 +```Go +SET CGO_ENABLED=1 +SET GOARCH=386 +go build main.go +``` +#### Ohter to windows +```Go +GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -x ./ +``` + ## Plans - 更新 Find an image on screen, read pixels from an image - 更新 Window Handle diff --git a/cdeps/README.md b/cdeps/README.md index 05e72ae..3303cf7 100644 --- a/cdeps/README.md +++ b/cdeps/README.md @@ -1 +1 @@ -C language dependent package, better compilation. \ No newline at end of file +C language dependent package, better to compilation. \ No newline at end of file