¯\_(ツ)_/¯

This commit is contained in:
ThePhD 2018-01-01 20:03:18 -05:00
parent 88ffe7b322
commit 1b94182c8d
6 changed files with 117 additions and 35 deletions

View File

@ -53,24 +53,24 @@ env:
GCC_VERSION=7 GCC_VERSION=7
CI=true CI=true
# LLVM 3.6.x -> 5.0.x # LLVM 3.6.x -> 5.0.x
- LUA_VERSION=5.3.4 #- LUA_VERSION=5.3.4
LLVM_VERSION=3.6.2 # LLVM_VERSION=3.6.2
CI=true # CI=true
- LUA_VERSION=5.3.4 #- LUA_VERSION=5.3.4
LLVM_VERSION=3.7.1 # LLVM_VERSION=3.7.1
CI=true # CI=true
- LUA_VERSION=5.3.4 #- LUA_VERSION=5.3.4
LLVM_VERSION=3.8.1 # LLVM_VERSION=3.8.1
CI=true # CI=true
- LUA_VERSION=5.3.4 #- LUA_VERSION=5.3.4
LLVM_VERSION=3.9.0 # LLVM_VERSION=3.9.0
CI=true # CI=true
- LUA_VERSION=5.3.4 #- LUA_VERSION=5.3.4
LLVM_VERSION=4.0.1 # LLVM_VERSION=4.0.1
CI=true # CI=true
- LUA_VERSION=5.3.4 #- LUA_VERSION=5.3.4
LLVM_VERSION=5.0.1 # LLVM_VERSION=5.0.1
CI=true # CI=true
# Lua Versions 5.2.4, 5.1.5, and maybe LuaJIT (as well as x86) # Lua Versions 5.2.4, 5.1.5, and maybe LuaJIT (as well as x86)
- LUA_VERSION=5.2.4 - LUA_VERSION=5.2.4
GCC_VERSION=7 GCC_VERSION=7

View File

@ -62,6 +62,13 @@ else()
add_compile_options(-Wno-unknown-warning -Wno-unknown-warning-option -Wall -Wextra -Wpedantic -pedantic -pedantic-errors) add_compile_options(-Wno-unknown-warning -Wno-unknown-warning-option -Wall -Wextra -Wpedantic -pedantic -pedantic-errors)
endif() endif()
if (CI)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
include_directories("$ENV{CLANG_PREFIX}/include/c++/v1")
#add_compile_options(-lc++)
endif()
endif()
# # # General project output locations # # # General project output locations
if (CMAKE_SIZEOF_VOID_P EQUAL 4) if (CMAKE_SIZEOF_VOID_P EQUAL 4)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/x86/lib") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/x86/lib")

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env zsh
# # # # sol2 # # # # sol2
# The MIT License (MIT) # The MIT License (MIT)
@ -22,9 +22,8 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
export LLVM_ARCHIVE_PATH=~/clang+llvm.tar.xz top_level_dir="$(pwd)"
export CLANG_PREFIX=$HOME/clang-$LLVM_VERSION export LLVM_ARCHIVE_PATH=${top_level_dir}/clang+llvm.tar.xz
export PATH=$LLVM_ARCHIVE_PATH:$PATH export CLANG_PREFIX=${top_level_dir}/clang-$LLVM_VERSION
export PATH=$CLANG_PREFIX/bin:$PATH
export LD_LIBRARY_PATH=$CLANG_PREFIX/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$CLANG_PREFIX/lib:$LD_LIBRARY_PATH
export CPPFLAGS="-I $CLANG_PREFIX/include/c++/v1"
export CXXFLAGS=-lc++

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env zsh
# # # # sol2 # # # # sol2
# The MIT License (MIT) # The MIT License (MIT)
@ -22,6 +22,36 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
get_script_dir () {
if [ -n "`$SHELL -c 'echo $ZSH_VERSION'`" ]
then
SOURCE="${(%):-%x}"
elif [ -n "`$SHELL -c 'echo $BASH_VERSION'`" ]
then
SOURCE="${BASH_SOURCE[0]}"
else
SOURCE="${0}"
fi
# While $SOURCE is a symlink, resolve it
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
echo "$DIR"
}
scripts_dir="$(get_script_dir)"
sol2_dir="${scripts_dir}/.."
mkdir -p build-sol2
cd build-sol2
top_level_dir="$(pwd)"
# # Initial and necessary installations # # Initial and necessary installations
sudo apt-get -y install ninja-build libreadline6 libreadline6-dev python3 wget curl libcurl3 cmake git sudo apt-get -y install ninja-build libreadline6 libreadline6-dev python3 wget curl libcurl3 cmake git
@ -32,12 +62,26 @@ sudo apt-get -y install ninja-build libreadline6 libreadline6-dev python3 wget c
if [ "$LLVM_VERSION" ] if [ "$LLVM_VERSION" ]
then then
# get and use LLVM # get and use LLVM
source /sol2/scripts/preparation.linux.llvm.sh source ${scripts_dir}/preparation.linux.llvm.sh
export CC=clang export CC=clang
export CXX=clang++ export CXX=clang++
wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz -O $LLVM_ARCHIVE_PATH version_nums=(${=LLVM_VERSION//./ })
major=$version_nums[1]
minor=$version_nums[2]
revision=$version_nums[3]
#sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
#sudo apt-get -y update
sudo apt-get -y install xz-utils
if [ $major -lt 4 ] && [ $minor -lt 8 ];
then
sudo apt-get -y install libstdc++6
wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH
else
sudo apt-get -y install clang clang++
wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-16.04.tar.xz -O $LLVM_ARCHIVE_PATH
fi
mkdir -p $CLANG_PREFIX mkdir -p $CLANG_PREFIX
tar xf $LLVM_ARCHIVE_PATH -C $CLANG_PREFIX --strip-components 1 tar xf "$LLVM_ARCHIVE_PATH" -C "$CLANG_PREFIX" --strip-components 1
elif [ "$GCC_VERSION" ] elif [ "$GCC_VERSION" ]
then then
# get and use GCC version that we desire # get and use GCC version that we desire
@ -55,3 +99,5 @@ else
export CC=cc export CC=cc
export CXX=c++ export CXX=c++
fi fi
cd ..

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env zsh
# # # # sol2 # # # # sol2
# The MIT License (MIT) # The MIT License (MIT)

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env zsh
# # # # sol2 # # # # sol2
# The MIT License (MIT) # The MIT License (MIT)
@ -22,11 +22,41 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Things we need
# https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
get_script_dir () {
if [ -n "`$SHELL -c 'echo $ZSH_VERSION'`" ]
then
SOURCE="${(%):-%x}"
elif [ -n "`$SHELL -c 'echo $BASH_VERSION'`" ]
then
SOURCE="${BASH_SOURCE[0]}"
else
SOURCE="${0}"
fi
# While $SOURCE is a symlink, resolve it
while [ -h "$SOURCE" ]; do
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$( readlink "$SOURCE" )"
# If $SOURCE was a relative symlink (so no "/" as prefix, need to resolve it relative to the symlink base directory
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
echo "$DIR"
}
scripts_dir="$(get_script_dir)"
sol2_dir="${scripts_dir}/.."
mkdir -p build-sol2
cd build-sol2
# This script runs the actual project # This script runs the actual project
mkdir -p Debug Release
if [ "$LLVM_VERSION" ] if [ "$LLVM_VERSION" ]
then then
source /sol2/scripts/preparation.linux.llvm.sh source ${scripts_dir}/preparation.linux.llvm.sh
export CC=clang export CC=clang
export CXX=clang++ export CXX=clang++
elif [ "$GCC_VERSION" ] elif [ "$GCC_VERSION" ]
@ -49,14 +79,14 @@ echo build_type_cxx: "${build_type_cxx}"
top_level=${PWD} top_level=${PWD}
cd /build-sol2/Debug cd Debug
cmake ../../sol2 -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DTESTS_SINGLE=ON -DCI=ON cmake ${sol2_dir} -G Ninja -DCMAKE_BUILD_TYPE=Debug ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DTESTS_SINGLE=ON -DCI=ON
cmake --build . --config Debug cmake --build . --config Debug
ctest -C Debug ctest -C Debug
cd ${top_level} cd ${top_level}
cd /build-sol2/Release cd Release
cmake ../../sol2 -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DTESTS_SINGLE=ON -DCI=ON cmake ${sol2_dir} -G Ninja -DCMAKE_BUILD_TYPE=Release ${build_type_cc} ${build_type_cxx} -DLUA_VERSION="${LUA_VERSION}" -DBUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DTESTS=ON -DEXAMPLES=ON -DSINGLE=ON -DTESTS_EXAMPLES=ON -DTESTS_SINGLE=ON -DCI=ON
cmake --build . --config Release cmake --build . --config Release
ctest -C Release ctest -C Release
cd ${top_level} cd ${top_level}