From 310e6e12f9304db4cc119c419f32ed66565ed04b Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Wed, 19 Dec 2018 11:36:25 -0500 Subject: [PATCH 1/2] Update travis build. --- .travis.yml | 122 ++++++++++++++++++++++++++++++++++++------------- CMakeLists.txt | 4 +- 2 files changed, 91 insertions(+), 35 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5f44e42a1..b873cfe9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,42 +1,98 @@ -# -# LuaDist Travis-CI Hook -# - -# We assume C build environments -language: C +language: cpp cache: ccache - -# Try using multiple Lua Implementations -env: - - TOOL="gcc" # Use native compiler (GCC usually) - - TOOL="clang" # Use clang - - TOOL="i686-w64-mingw32" # 32bit MinGW - - TOOL="x86_64-w64-mingw32" # 64bit MinGW - - TOOL="arm-linux-gnueabihf" # ARM hard-float (hf), linux - -# Crosscompile builds may fail +dist: xenial matrix: - allow_failures: - - env: TOOL="i686-w64-mingw32" - - env: TOOL="x86_64-w64-mingw32" - - env: TOOL="arm-linux-gnueabihf" + include: + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + - liblua5.3-dev + env: + - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-6 + - liblua5.3-dev + env: + - MATRIX_EVAL="CC=gcc-6 && CXX=g++-6" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + - liblua5.3-dev + env: + - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-8 + - liblua5.3-dev + env: + - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" + - os: linux + addons: + apt: + sources: + - llvm-toolchain-xenial-6.0 + packages: + - clang-6.0 + - liblua5.3-dev + env: + - MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0" + - os: linux + addons: + apt: + sources: + - llvm-toolchain-xenial-7 + packages: + - clang-7 + - liblua5.3-dev + env: + - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" + - os: osx + osx_image: xcode9.4 + - os: osx + osx_image: xcode10 + - os: osx + osx_image: xcode10.1 -# Install dependencies -install: - - git clone git://github.com/LuaDist/Tools.git ~/_tools - - ~/_tools/travis/travis install +before_install: + - | + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + brew update; + brew install lua ccache; + export PATH="/usr/local/opt/ccache/libexec:$PATH"; + fi + - eval "${MATRIX_EVAL}" + # Combine global build options with OS/compiler-dependent options + - export CMAKE_OPTIONS="${CMAKE_OPTIONS} ${ENV_CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" + - export CXX_FLAGS="${CXX_FLAGS} ${ENV_CXX_FLAGS}" -# Bootstap -before_script: - - ~/_tools/travis/travis bootstrap +install: + - echo ${PATH} + - echo ${CXX} + - ${CXX} --version + - ${CXX} -v -# Build the module script: - - ~/_tools/travis/travis build - -# Execute additional tests or commands -after_script: - - ~/_tools/travis/travis test + - mkdir -p build + - cd build + - cmake ${CMAKE_OPTIONS} -DCMAKE_CXX_FLAGS=${CXX_FLAGS} .. + - make -j4 # Only watch the master branch branches: diff --git a/CMakeLists.txt b/CMakeLists.txt index bc640b166..a1d42c6b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ include ( cmake/dist.cmake ) include(FindPkgConfig) -pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51) -include_directories ( include src/lib ${LUA_INCLUDE_DIR} ) +pkg_search_module(LUA REQUIRED lua>=5.3 lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua>=5.1 luajit) +include_directories ( include src/lib ${LUA_INCLUDE_DIRS} ) # Build lib file ( GLOB SRC_LIBTOLUAPP src/lib/*.c ) From e813b64fa6eeee989f0b7bae6fbf4e226be8a4b1 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Wed, 19 Dec 2018 13:49:02 -0500 Subject: [PATCH 2/2] Build shared and static libs. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1d42c6b8..27c972cac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,8 @@ if ( MSVC ) set ( DEF_FILE libtoluapp.def ) endif ( ) -add_library ( toluapp_lib ${SRC_LIBTOLUAPP} ${DEF_FILE} ) +add_library ( toluapp_lib SHARED ${SRC_LIBTOLUAPP} ${DEF_FILE} ) +add_library ( toluapp_lib_static STATIC ${SRC_LIBTOLUAPP} ${DEF_FILE} ) target_link_libraries ( toluapp_lib ${LUA_LIBRARIES} ) set_target_properties ( toluapp_lib PROPERTIES OUTPUT_NAME toluapp CLEAN_DIRECT_OUTPUT 1 )