diff --git a/.travis.yml b/.travis.yml index 6d168ed2..06fdd954 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ before_install: script: - export SOL2_DIR=${TRAVIS_BUILD_DIR} - sudo docker image pull thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} -- sudo docker run --rm --interactive --tty --name "sol2.test" -v "${SOL2_DIR}:/root/sol2" --env "CI=${CI}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} +- sudo docker run --rm --interactive --tty --name "sol2.test" -v "${SOL2_DIR}:/root/sol2" --env "CI=${CI}" --env "PLATFORM=${PLATFORM}" --env "LUA_VERSION=${LUA_VERSION}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} - sudo docker rmi $(sudo docker image ls -q) matrix: @@ -47,67 +47,67 @@ matrix: - env: - LUA_VERSION=5.3.4 GCC_VERSION=4.9 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=5.3.4 GCC_VERSION=5 CI=true - platform=x64 + PLATFORM=x64 - env: - LUA_VERSION=5.3.4 GCC_VERSION=6 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=5.3.4 GCC_VERSION=7 - platform=x64 + PLATFORM=x64 CI=true # LLVM 3.6.x -> 5.0.x - env: - LUA_VERSION=5.3.4 LLVM_VERSION=3.6.2 - platform=x64 + PLATFORM=x64 CI=true ALLOW_FAILURE=true - env: - LUA_VERSION=5.3.4 LLVM_VERSION=3.7.1 - platform=x64 + PLATFORM=x64 CI=true ALLOW_FAILURE=true - env: - LUA_VERSION=5.3.4 LLVM_VERSION=3.8.1 - platform=x64 + PLATFORM=x64 CI=true ALLOW_FAILURE=true - env: - LUA_VERSION=5.3.4 LLVM_VERSION=3.9.1 - platform=x64 + PLATFORM=x64 CI=true ALLOW_FAILURE=true - env: - LUA_VERSION=5.3.4 LLVM_VERSION=4.0.1 - platform=x64 + PLATFORM=x64 CI=true ALLOW_FAILURE=true - env: - LUA_VERSION=5.3.4 LLVM_VERSION=5.0.1 - platform=x64 + PLATFORM=x64 CI=true ALLOW_FAILURE=true @@ -115,43 +115,43 @@ matrix: - env: - LUA_VERSION=5.2.4 GCC_VERSION=7 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=5.1.5 GCC_VERSION=7 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=luajit-2.0.4 GCC_VERSION=7 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=luajit-2.0.5 GCC_VERSION=7 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=luajit-2.1.0-beta3 GCC_VERSION=7 - platform=x64 + PLATFORM=x64 CI=true - env: - LUA_VERSION=luajit-2.0.5 GCC_VERSION=7 - platform=x86 + PLATFORM=x86 CI=true - env: - LUA_VERSION=luajit-2.1.0-beta3 GCC_VERSION=7 - platform=x86 + PLATFORM=x86 CI=true notifications: diff --git a/CMakeLists.txt b/CMakeLists.txt index 366bc2b8..283c9636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,6 +59,14 @@ if (MSVC) add_compile_options(/MP) endif() else() + if (x86) + list(APPEND CMAKE_C_FLAGS "-m32") + list(APPEND CMAKE_CXX_FLAGS "-m32") + list(APPEND CMAKE_EXE_LINKER_FLAGS "-m32") + list(APPEND CMAKE_MODULE_LINKER_FLAGS "-m32") + list(APPEND CMAKE_STATIC_LINKER_FLAGS "-m32") + list(APPEND CMAKE_SHARED_LINKER_FLAGS "-m32") + endif() add_compile_options(-Wno-unknown-warning -Wno-unknown-warning-option -Wall -Wextra -Wpedantic -pedantic -pedantic-errors) endif() diff --git a/Dockerfile b/Dockerfile index d7e41f93..e304171c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,9 +51,10 @@ VOLUME /root/sol2 ARG CI=true ARG GCC_VERSION ARG LLVM_VERSION +ARG PLATFORM=x64 # Potential environment variables -ENV GCC_VERSION=${GCC_VERSION} LLVM_VERSION=${LLVM_VERSION} CI=${CI} SOL2_DIR=/root/sol2 +ENV CI=${CI} PLATFORM=${PLATFORM} GCC_VERSION=${GCC_VERSION} LLVM_VERSION=${LLVM_VERSION} SOL2_DIR=/root/sol2 RUN ["/usr/bin/env", "zsh", "-e", "/root/sol2-scripts/preparation.linux.sh"] diff --git a/appveyor.yml b/appveyor.yml index 968313db..b3501fb1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -70,8 +70,6 @@ matrix: # Also does not have MinGW x64 for 5.3.0 - image: Visual Studio 2017 MINGW_VERSION: 6.3.0 - - platform: x86 - MINGW_VERSION: 6.3.0 # LLVM exists in all images, and we only want the VS 2017 x64 versions - image: Visual Studio 2015 LLVM_VERSION: 4.0.0 diff --git a/scripts/build.linux.sh b/scripts/build.linux.sh index 71d67f81..c43ae6c6 100644 --- a/scripts/build.linux.sh +++ b/scripts/build.linux.sh @@ -52,25 +52,24 @@ else fi echo "====== ======= ======= ======= ======" -echo "====== Pushing All Docker Images ======" +echo "====== Building All Docker Images ======" echo "====== ======= ======= ======= ======" for i in $gcc_versions; do GCC_VERSION=$i unset LLVM_VERSION - echo "====== Pushing Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} =======" - docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} + echo "====== Building Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} =======" + docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}" done for i in $llvm_versions; do LLVM_VERSION=$i unset GCC_VERSION - echo "====== Pushing Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} =======" - docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} + echo "====== Building Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} =======" + docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}" done unset LLVM_VERSION unset GCC_VERSION -echo "====== Pushing Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} =======" -docker push ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} - +echo "====== Building Docker Image: ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} =======" +docker build --tag ${docker_username}sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} --build-arg GCC_VERSION=${GCC_VERSION} --build-arg LLVM_VERSION=${LLVM_VERSION} --build-arg CI=${CI} "${SOL2_DIR}" diff --git a/scripts/preparation.linux.sh b/scripts/preparation.linux.sh index 4f4e4813..2cbda83a 100644 --- a/scripts/preparation.linux.sh +++ b/scripts/preparation.linux.sh @@ -32,7 +32,7 @@ build_dir="$(pwd)" echo "#\!/usr/bin/env zsh\n\n" > "sol2.compiler.vars" # # Initial and necessary installations -apt-get -y install ninja-build libreadline6 libreadline6-dev python3 wget curl libcurl3 cmake git +apt-get update && apt-get -y install ninja-build libreadline6 libreadline6-dev lib32readline6 lib32readline6-dev python3 wget curl libcurl3 cmake git # # LLVM and GCC updates # Grab LLVM or GCC @@ -93,13 +93,13 @@ then add-apt-repository -y ppa:ubuntu-toolchain-r/test apt-get -y update apt-get -y dist-upgrade - apt-get -y install gcc-$GCC_VERSION g++-$GCC_VERSION - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 60 --slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION + apt-get -y install gcc-${GCC_VERSION} g++-${GCC_VERSION} gcc-${GCC_VERSION}-multilib g++-${GCC_VERSION}-multilib + update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 60 --slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} update-alternatives --config gcc - export CC=gcc-$GCC_VERSION - export CXX=g++-$GCC_VERSION + export CC=gcc-${GCC_VERSION} + export CXX=g++-${GCC_VERSION} else - apt-get -y install build-essential + apt-get -y install build-essential gcc-multilib g++-multilib export CC=cc export CXX=c++ fi diff --git a/scripts/run.linux.sh b/scripts/run.linux.sh index d861997c..a31e5238 100644 --- a/scripts/run.linux.sh +++ b/scripts/run.linux.sh @@ -70,7 +70,7 @@ echo -en "travis_fold:end:build_preparation.2\r" echo -en "travis_fold:start:build.debug\r" cd Debug - cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON + cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -D${PLATFORM}=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON cmake --build . --config Debug echo -en "travis_fold:end:build.debug\r" echo -en "travis_fold:start:test.debug\r" @@ -80,7 +80,7 @@ echo -en "travis_fold:end:test.debug\r" echo "travis_fold:start:build.release\r" cd Release - cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON + cmake ${SOL2_DIR} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DCI=ON -D${PLATFORM}=ON -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DEXAMPLES_SINGLE=ON -DTESTS_SINGLE=ON cmake --build . --config Release echo -en "travis_fold:end:build.release\r" echo -en "travis_fold:start:test.release\r"