mirror of
				https://github.com/bensuperpc/dockcross.git
				synced 2025-10-30 23:56:23 +01:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			update_con
			...
			update_con
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| a9dda23ae7 | |||
| 0fc1c34f29 | |||
| 84d4b38037 | 
| @@ -189,7 +189,7 @@ Once this part is finished, there must be 3 files in the **linux-arm64** folder: | ||||
| - **Dockerfile.in**, the docker file. | ||||
| - **Toolchain.cmake**, the CMake file for the toolchains. | ||||
|  | ||||
| ### Makefile and CI | ||||
| ### Makefile | ||||
|  | ||||
| For this last part, we will see how to add the image to the [Makefile](Makefile) and to a github action. | ||||
|  | ||||
| @@ -225,6 +225,42 @@ GEN_IMAGES = android-arm android-arm64 \ | ||||
|  linux-riscv64 linux-riscv32 linux-m68k-uclibc linux-x64-tinycc linux-xtensa-uclibc | ||||
| ``` | ||||
|  | ||||
| ### Image building and testing | ||||
|  | ||||
| You can now start building the image: | ||||
|  | ||||
| ```bash | ||||
| make linux-arm64 | ||||
| ``` | ||||
|  | ||||
| When finished, you can test it: | ||||
|  | ||||
| ```bash | ||||
| make linux-arm64.test | ||||
| ``` | ||||
|  | ||||
| If you want to go a little further in the tests: | ||||
|  | ||||
| ```bash | ||||
| docker run --rm linux-arm64 > ./linux-arm64 | ||||
| chmod +x ./linux-arm64 | ||||
| ``` | ||||
|  | ||||
| And then run the commands to build a project (you must be in the directory of your project to build): | ||||
|  | ||||
| ```bash | ||||
| ./linux-arm64 make | ||||
| ``` | ||||
|  | ||||
| With CMake + Ninja: | ||||
|  | ||||
| ```bash | ||||
| ./linux-arm64 cmake -Bbuild -S. -GNinja | ||||
| ./linux-arm64 ninja -Cbuild | ||||
| ``` | ||||
|  | ||||
| ### CI (github action) | ||||
|  | ||||
| To finish, you have to add to [Github Action](.github/workflows/main.yml) the image/folder name: | ||||
|  | ||||
| ```yml | ||||
|   | ||||
| @@ -25,7 +25,7 @@ Cross compiling toolchains in Docker images. | ||||
| ## Examples | ||||
|  | ||||
| 1. `dockcross make`: Build the *Makefile* in the current directory. | ||||
| 2. `dockcross cmake -Bbuild -H. -GNinja`: Run CMake with a build directory `./build` for a *CMakeLists.txt* file in the current directory and generate `ninja` build configuration files. | ||||
| 2. `dockcross cmake -Bbuild -S. -GNinja`: Run CMake with a build directory `./build` for a *CMakeLists.txt* file in the current directory and generate `ninja` build configuration files. | ||||
| 3. `dockcross ninja -Cbuild`: Run ninja in the `./build` directory. | ||||
| 4. `dockcross bash -c '$CC test/C/hello.c -o hello'`: Build the *hello.c* file with the compiler identified with the `CC` environmental variable in the build environment. | ||||
| 5. `dockcross bash`: Run an interactive shell in the build environment. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user