diff --git a/compile_linux.sh b/compile_linux.sh index 3cd1e06..f2ee29f 100755 --- a/compile_linux.sh +++ b/compile_linux.sh @@ -4,7 +4,7 @@ if [ ! $# -eq 2 ] then echo "Usage: ./compile_linux.sh " echo "" - echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)." + echo "architecture: the target architecture to build for. Architectures are either 386 or amd64." echo "buildType: either Release or Debug" exit 1 fi diff --git a/compile_macosx.sh b/compile_macosx.sh new file mode 100755 index 0000000..cf7bc5e --- /dev/null +++ b/compile_macosx.sh @@ -0,0 +1,52 @@ +#!/bin/bash +set -e + +if [ ! $# -eq 2 ] + then + echo "Usage: ./compile_macosx.sh " + echo "" + echo "architecture: the target architecture to build for. Architectures are either amd64 or arm64." + echo "buildType: either Release or Debug" + exit 1 +fi + +TARGETARCH=$1 +BUILD_TYPE=$2 + +# Determine architecture +echo "Building for architecture $TARGETARCH" + +if [ ! -f "jcef/README.md" ]; then + echo "Did not find existing files to build - cloning..." + rm -rf jcef + git clone https://bitbucket.org/chromiumembedded/java-cef.git jcef +else + echo "Found existing files to build" +fi + +# Enter the JCEF source code directory. +cd jcef + +# Create and enter the `jcef_build` directory. +# The `jcef_build` directory name is required by other JCEF tooling +# and should not be changed. +mkdir jcef_build && cd jcef_build + +# MacOS: Generate amd64/arm64 Makefiles. +if [ ${TARGETARCH} == 'amd64' ]; then + cmake -G "Ninja" -DPROJECT_ARCH="x86_64" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. +else + cmake -G "Ninja" -DPROJECT_ARCH="arm64" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. +fi +# Build native part using ninja. +ninja -j4 + +#Generate distribution +cd ../tools +chmod +x make_distrib.sh +./make_distrib.sh macosx64 + +#Pack binary_distrib +cd ../binary_distrib/macosx64 +mkdir ../../out +tar -czvf ../../out/binary_distrib.tar.gz * diff --git a/compile_windows.bat b/compile_windows.bat index 95d2669..c1182b8 100755 --- a/compile_windows.bat +++ b/compile_windows.bat @@ -3,7 +3,7 @@ if ("%2"=="") ( ^ echo "Usage: compile_windows.bat " && ^ echo "" && ^ - echo "architecture: the target architecture to build for. Architectures are the docker architectures (e.g. 386 or amd64)." && ^ + echo "architecture: the target architecture to build for. Architectures are either 386 or amd64." && ^ echo "buildType: either Release or Debug" && ^ exit 1 ^ ) diff --git a/scripts/run_windows.bat b/scripts/run_windows.bat index 0208d35..be47fe8 100644 --- a/scripts/run_windows.bat +++ b/scripts/run_windows.bat @@ -1,4 +1,4 @@ -@echo off +@echo on if "%TARGETARCH%"=="386" (echo "Building 32-bit version") ^ else (echo "Building 64-bit version") @@ -6,7 +6,9 @@ else (echo "Building 64-bit version") #Check residency of workdir cd C: if exist "jcef\README.md" (echo "Found existing files to build") ^ -else (echo "Did not find files to build - cloning..." && rmdir /S /Q jcef && git clone https://bitbucket.org/chromiumembedded/java-cef jcef) +else (echo "Did not find files to build - cloning..." && GOTO :CLONE) + +:BUILD cd jcef #Prepare build dir @@ -31,3 +33,10 @@ if "%TARGETARCH%"=="386" (make_distrib.bat win32) else (make_distrib.bat win64) if "%TARGETARCH%"=="386" (cd ../binary_distrib/win32) else (cd ../binary_distrib/win64) del /F C:\out\binary_distrib.tar.gz tar -czvf C:\out\binary_distrib.tar.gz * + +GOTO :EOF + +:CLONE +if exist jcef rmdir /S /Q jcef +git clone https://bitbucket.org/chromiumembedded/java-cef jcef +GOTO :BUILD