mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-12-22 16:24:27 +01:00
base: Add cmake wrapper scripts for CMAKE_TOOLCHAIN_FILE
All images should define this variables. Disable build tests on the base image because it is not configured for cross compiling.
This commit is contained in:
parent
041eb8702b
commit
1ed3548655
@ -58,6 +58,7 @@ RUN git clone git://cmake.org/cmake.git CMake && \
|
|||||||
make install && \
|
make install && \
|
||||||
cd .. && \
|
cd .. && \
|
||||||
rm -rf CMake*
|
rm -rf CMake*
|
||||||
|
# Wrappers that point to CMAKE_TOOLCHAIN_FILE
|
||||||
|
|
||||||
# Build and install Ninja from source
|
# Build and install Ninja from source
|
||||||
RUN git clone https://github.com/martine/ninja.git && \
|
RUN git clone https://github.com/martine/ninja.git && \
|
||||||
@ -67,6 +68,8 @@ RUN git clone https://github.com/martine/ninja.git && \
|
|||||||
./ninja && \
|
./ninja && \
|
||||||
cp ./ninja /usr/bin/ && \
|
cp ./ninja /usr/bin/ && \
|
||||||
cd .. && rm -rf ninja
|
cd .. && rm -rf ninja
|
||||||
|
COPY imagefiles/cmake.sh /usr/local/bin/cmake
|
||||||
|
COPY imagefiles/ccmake.sh /usr/local/bin/ccmake
|
||||||
|
|
||||||
RUN echo "root:root" | chpasswd
|
RUN echo "root:root" | chpasswd
|
||||||
WORKDIR /work
|
WORKDIR /work
|
||||||
|
17
Makefile
17
Makefile
@ -20,7 +20,7 @@ browser-asmjs: base browser-asmjs/Dockerfile
|
|||||||
|
|
||||||
browser-asmjs.test: browser-asmjs test/run.py
|
browser-asmjs.test: browser-asmjs test/run.py
|
||||||
$(DOCKER) run --rm dockcross/browser-asmjs > $(BIN)/dockcross-browser-asmjs && chmod +x $(BIN)/dockcross-browser-asmjs
|
$(DOCKER) run --rm dockcross/browser-asmjs > $(BIN)/dockcross-browser-asmjs && chmod +x $(BIN)/dockcross-browser-asmjs
|
||||||
$(BIN)/dockcross-browser-asmjs python test/run.py --emulator /usr/bin/node --exe-suffix ".js"
|
$(BIN)/dockcross-browser-asmjs python test/run.py --exe-suffix ".js"
|
||||||
|
|
||||||
linux-x86: base linux-x86/Dockerfile linux-x86/Toolchain.cmake
|
linux-x86: base linux-x86/Dockerfile linux-x86/Toolchain.cmake
|
||||||
$(DOCKER) build -t $(ORG)/linux-x86 linux-x86
|
$(DOCKER) build -t $(ORG)/linux-x86 linux-x86
|
||||||
@ -41,49 +41,49 @@ linux-arm64: base linux-arm64/Dockerfile linux-arm64/Toolchain.cmake
|
|||||||
|
|
||||||
linux-arm64.test: linux-arm64 test/run.py
|
linux-arm64.test: linux-arm64 test/run.py
|
||||||
$(DOCKER) run --rm dockcross/linux-arm64 > $(BIN)/dockcross-linux-arm64 && chmod +x $(BIN)/dockcross-linux-arm64
|
$(DOCKER) run --rm dockcross/linux-arm64 > $(BIN)/dockcross-linux-arm64 && chmod +x $(BIN)/dockcross-linux-arm64
|
||||||
$(BIN)/dockcross-linux-arm64 python test/run.py --emulator /usr/bin/qemu-aarch64
|
$(BIN)/dockcross-linux-arm64 python test/run.py
|
||||||
|
|
||||||
linux-armv5: base linux-armv5/Dockerfile linux-armv5/Toolchain.cmake
|
linux-armv5: base linux-armv5/Dockerfile linux-armv5/Toolchain.cmake
|
||||||
$(DOCKER) build -t $(ORG)/linux-armv5 linux-armv5
|
$(DOCKER) build -t $(ORG)/linux-armv5 linux-armv5
|
||||||
|
|
||||||
linux-armv5.test: linux-armv5 test/run.py
|
linux-armv5.test: linux-armv5 test/run.py
|
||||||
$(DOCKER) run --rm dockcross/linux-armv5 > $(BIN)/dockcross-linux-armv5 && chmod +x $(BIN)/dockcross-linux-armv5
|
$(DOCKER) run --rm dockcross/linux-armv5 > $(BIN)/dockcross-linux-armv5 && chmod +x $(BIN)/dockcross-linux-armv5
|
||||||
$(BIN)/dockcross-linux-armv5 python test/run.py --emulator /usr/bin/qemu-arm
|
$(BIN)/dockcross-linux-armv5 python test/run.py
|
||||||
|
|
||||||
linux-armv6: base linux-armv6/Dockerfile linux-armv6/Toolchain.cmake
|
linux-armv6: base linux-armv6/Dockerfile linux-armv6/Toolchain.cmake
|
||||||
$(DOCKER) build -t $(ORG)/linux-armv6 linux-armv6
|
$(DOCKER) build -t $(ORG)/linux-armv6 linux-armv6
|
||||||
|
|
||||||
linux-armv6.test: linux-armv6 test/run.py
|
linux-armv6.test: linux-armv6 test/run.py
|
||||||
$(DOCKER) run --rm dockcross/linux-armv6 > $(BIN)/dockcross-linux-armv6 && chmod +x $(BIN)/dockcross-linux-armv6
|
$(DOCKER) run --rm dockcross/linux-armv6 > $(BIN)/dockcross-linux-armv6 && chmod +x $(BIN)/dockcross-linux-armv6
|
||||||
$(BIN)/dockcross-linux-armv6 python test/run.py --emulator /usr/bin/qemu-arm
|
$(BIN)/dockcross-linux-armv6 python test/run.py
|
||||||
|
|
||||||
linux-armv7: base linux-armv7/Dockerfile linux-armv7/Toolchain.cmake
|
linux-armv7: base linux-armv7/Dockerfile linux-armv7/Toolchain.cmake
|
||||||
$(DOCKER) build -t $(ORG)/linux-armv7 linux-armv7
|
$(DOCKER) build -t $(ORG)/linux-armv7 linux-armv7
|
||||||
|
|
||||||
linux-armv7.test: linux-armv7 test/run.py
|
linux-armv7.test: linux-armv7 test/run.py
|
||||||
$(DOCKER) run --rm dockcross/linux-armv7 > $(BIN)/dockcross-linux-armv7 && chmod +x $(BIN)/dockcross-linux-armv7
|
$(DOCKER) run --rm dockcross/linux-armv7 > $(BIN)/dockcross-linux-armv7 && chmod +x $(BIN)/dockcross-linux-armv7
|
||||||
$(BIN)/dockcross-linux-armv7 python test/run.py --emulator /usr/bin/qemu-arm
|
$(BIN)/dockcross-linux-armv7 python test/run.py
|
||||||
|
|
||||||
linux-ppc64le: base linux-ppc64le/Dockerfile linux-ppc64le/Toolchain.cmake
|
linux-ppc64le: base linux-ppc64le/Dockerfile linux-ppc64le/Toolchain.cmake
|
||||||
$(DOCKER) build -t $(ORG)/linux-ppc64le linux-ppc64le
|
$(DOCKER) build -t $(ORG)/linux-ppc64le linux-ppc64le
|
||||||
|
|
||||||
linux-ppc64le.test: linux-ppc64le test/run.py
|
linux-ppc64le.test: linux-ppc64le test/run.py
|
||||||
$(DOCKER) run --rm dockcross/linux-ppc64le > $(BIN)/dockcross-linux-ppc64le && chmod +x $(BIN)/dockcross-linux-ppc64le
|
$(DOCKER) run --rm dockcross/linux-ppc64le > $(BIN)/dockcross-linux-ppc64le && chmod +x $(BIN)/dockcross-linux-ppc64le
|
||||||
$(BIN)/dockcross-linux-ppc64le python test/run.py --emulator /usr/bin/qemu-ppc64le --languages C
|
$(BIN)/dockcross-linux-ppc64le python test/run.py --languages C
|
||||||
|
|
||||||
windows-x86: base windows-x86/Dockerfile windows-x86/settings.mk
|
windows-x86: base windows-x86/Dockerfile windows-x86/settings.mk
|
||||||
$(DOCKER) build -t $(ORG)/windows-x86 windows-x86
|
$(DOCKER) build -t $(ORG)/windows-x86 windows-x86
|
||||||
|
|
||||||
windows-x86.test: windows-x86 test/run.py
|
windows-x86.test: windows-x86 test/run.py
|
||||||
$(DOCKER) run --rm dockcross/windows-x86 > $(BIN)/dockcross-windows-x86 && chmod +x $(BIN)/dockcross-windows-x86
|
$(DOCKER) run --rm dockcross/windows-x86 > $(BIN)/dockcross-windows-x86 && chmod +x $(BIN)/dockcross-windows-x86
|
||||||
$(BIN)/dockcross-windows-x86 python test/run.py --emulator /usr/bin/wine --exe-suffix ".exe"
|
$(BIN)/dockcross-windows-x86 python test/run.py --exe-suffix ".exe"
|
||||||
|
|
||||||
windows-x64: base windows-x64/Dockerfile windows-x64/settings.mk
|
windows-x64: base windows-x64/Dockerfile windows-x64/settings.mk
|
||||||
$(DOCKER) build -t $(ORG)/windows-x64 windows-x64
|
$(DOCKER) build -t $(ORG)/windows-x64 windows-x64
|
||||||
|
|
||||||
windows-x64.test: windows-x64 test/run.py
|
windows-x64.test: windows-x64 test/run.py
|
||||||
$(DOCKER) run --rm dockcross/windows-x64 > $(BIN)/dockcross-windows-x64 && chmod +x $(BIN)/dockcross-windows-x64
|
$(DOCKER) run --rm dockcross/windows-x64 > $(BIN)/dockcross-windows-x64 && chmod +x $(BIN)/dockcross-windows-x64
|
||||||
$(BIN)/dockcross-windows-x64 python test/run.py --emulator /usr/bin/wine --exe-suffix ".exe"
|
$(BIN)/dockcross-windows-x64 python test/run.py --exe-suffix ".exe"
|
||||||
|
|
||||||
base: Dockerfile
|
base: Dockerfile
|
||||||
$(DOCKER) build -t $(ORG)/base .
|
$(DOCKER) build -t $(ORG)/base .
|
||||||
@ -91,6 +91,5 @@ base: Dockerfile
|
|||||||
base.test: base test/run.py
|
base.test: base test/run.py
|
||||||
mkdir -p $(BIN)
|
mkdir -p $(BIN)
|
||||||
$(DOCKER) run --rm dockcross/base > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base
|
$(DOCKER) run --rm dockcross/base > $(BIN)/dockcross-base && chmod +x $(BIN)/dockcross-base
|
||||||
$(BIN)/dockcross-base python test/run.py --emulator 'sh -c'
|
|
||||||
|
|
||||||
.PHONY: images base android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 windows-x86 windows-x64 tests %.test
|
.PHONY: images base android-arm linux-x86 linux-x64 linux-arm64 linux-armv5 linux-armv6 linux-armv7 windows-x86 windows-x64 tests %.test
|
||||||
|
6
imagefiles/ccmake.sh
Executable file
6
imagefiles/ccmake.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Always pass the CMAKE_TOOLCHAIN_FILE variable to CMake when inside a
|
||||||
|
# dockcross environment -- the CMAKE_TOOLCHAIN_FILE environmental variable is
|
||||||
|
# always set in this context
|
||||||
|
exec /usr/bin/ccmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} "$@"
|
6
imagefiles/cmake.sh
Executable file
6
imagefiles/cmake.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Always pass the CMAKE_TOOLCHAIN_FILE variable to CMake when inside a
|
||||||
|
# dockcross environment -- the CMAKE_TOOLCHAIN_FILE environmental variable is
|
||||||
|
# always set in this context
|
||||||
|
exec /usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} "$@"
|
@ -58,10 +58,6 @@ def test_cmake_build_system(build_dir, language, source, emulator, linker_flags,
|
|||||||
if linker_flags:
|
if linker_flags:
|
||||||
cmake_configuration_cmd.insert(1,
|
cmake_configuration_cmd.insert(1,
|
||||||
'-DCMAKE_EXE_LINKER_FLAGS="{0}"'.format(' '.join(linker_flags)))
|
'-DCMAKE_EXE_LINKER_FLAGS="{0}"'.format(' '.join(linker_flags)))
|
||||||
toolchain_file = os.getenv('CMAKE_TOOLCHAIN_FILE')
|
|
||||||
if toolchain_file:
|
|
||||||
cmake_configuration_cmd.insert(1,
|
|
||||||
'-DCMAKE_TOOLCHAIN_FILE={0}'.format(toolchain_file))
|
|
||||||
print(' '.join(cmake_configuration_cmd))
|
print(' '.join(cmake_configuration_cmd))
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
if subprocess.call(cmake_configuration_cmd):
|
if subprocess.call(cmake_configuration_cmd):
|
||||||
|
Loading…
Reference in New Issue
Block a user