Skip to content

Commit

Permalink
Merge pull request #1 from brndnmtthws/update-build
Browse files Browse the repository at this point in the history
Update build
  • Loading branch information
brndnmtthws authored Dec 19, 2018
2 parents 9eb16ef + e813b64 commit eb8f9fd
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 36 deletions.
122 changes: 89 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ 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 )
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 )
Expand Down

0 comments on commit eb8f9fd

Please sign in to comment.