use gcc on linux and clang on osx

This commit is contained in:
arvidn 2015-08-31 23:23:10 -04:00
parent 379fd8ce81
commit b45c585a78
13 changed files with 52 additions and 39 deletions

View File

@ -1,15 +1,15 @@
language: cpp language: cpp
os: os:
- linux # - linux
# - osx - osx
env: env:
- variant=test_debug cc=gcc-cpp11 sim=1 - variant=test_debug lang=cpp11 sim=1
- variant=test_debug cc=clang-cpp11 sim=0 # - variant=test_debug lang=cpp11 sim=0
- variant=test_debug cc=gcc-cpp98 sim=0 # - variant=test_debug lang=cpp98 sim=0
- variant=test_release cc=gcc-cpp11 sim=0 # - variant=test_release lang=cpp11 sim=0
- variant=test_barebones cc=gcc-cpp11 sim=0 # - variant=test_barebones lang=cpp11 sim=0
git: git:
submodules: false submodules: false
@ -40,26 +40,33 @@ addons:
before_install: before_install:
- git submodule update --init --recursive - git submodule update --init --recursive
- if [ $TRAVIS_OS_NAME == "osx" ]; then brew install --quiet ccache boost-build boost-python; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then export toolset="darwin-${lang}"; fi
- if [ $TRAVIS_OS_NAME == "linux" ]; then export toolset="gcc-${lang}"; fi
install: install:
- 'echo "using toolset: " ${toolset}'
- 'echo "using gcc : cpp11 : ccache g++-4.8 : <cflags>-std=c11 <cxxflags>-std=c++11 ;" > ~/user-config.jam' - 'echo "using gcc : cpp11 : ccache g++-4.8 : <cflags>-std=c11 <cxxflags>-std=c++11 ;" > ~/user-config.jam'
- 'echo "using gcc : cpp98 : ccache g++-4.8 : <cflags>-std=c99 <cxxflags>-std=c++98 ;" >> ~/user-config.jam' - 'echo "using gcc : cpp98 : ccache g++-4.8 : <cflags>-std=c99 <cxxflags>-std=c++98 ;" >> ~/user-config.jam'
- 'echo "using clang : cpp11 : ccache clang++ : <cflags>-std=c11 <cxxflags>-std=c++11 ;" >> ~/user-config.jam' # osx builds need to disable the deprecated warning because of the openssl
- 'echo "using clang : cpp98 : ccache clang++ : <cflags>-std=c99 <cxxflags>-std=c++98 ;" >> ~/user-config.jam' # shipping with the system having marked all functions as deprecated. Since
# we're building with -Werror, we can't have those warnings
- 'echo "using darwin : cpp11 : ccache clang++ : <cflags>-std=c11 <cxxflags>-std=c++11 <compileflags>-Wno-deprecated-declarations ;" >> ~/user-config.jam'
- 'echo "using darwin : cpp98 : ccache clang++ : <cflags>-std=c99 <cxxflags>-std=c++98 <compileflags>-Wno-deprecated-declarations ;" >> ~/user-config.jam'
- 'echo "using python : 2.7 ;" >> ~/user-config.jam' - 'echo "using python : 2.7 ;" >> ~/user-config.jam'
- ccache -V && ccache --show-stats && ccache --zero-stats - ccache -V && ccache --show-stats && ccache --zero-stats
script: script:
- cd test - cd test
- bjam --hash -j3 warnings-as-errors=on variant=$variant -l900 $CC - bjam --hash -j3 warnings-as-errors=on variant=$variant -l900 $toolset
- cd ../examples - cd ../examples
- bjam --hash -j3 warnings-as-errors=on variant=$variant $CC - bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset
- cd ../bindings/python - cd ../bindings/python
- bjam --hash -j3 warnings-as-errors=on variant=$variant $CC stage_module - bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset stage_module
- LD_LIBRARY_PATH=. python test.py - LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. python test.py
- if [ $sim ]; then - if [ $sim ]; then
cd ../../simulation; cd ../../simulation;
bjam --hash -j3 crypto=built-in $CC; bjam --hash -j3 crypto=built-in $toolset;
fi fi
- ccache --show-stats - ccache --show-stats

View File

@ -213,7 +213,7 @@ namespace libtorrent {
// hidden // hidden
virtual ~alert(); virtual ~alert();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
alert(alert const& st) = default; alert(alert const&) = default;
#endif #endif
// a timestamp is automatically created in the constructor // a timestamp is automatically created in the constructor

View File

@ -173,8 +173,8 @@ namespace libtorrent
cached_piece_entry(); cached_piece_entry();
~cached_piece_entry(); ~cached_piece_entry();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
cached_piece_entry(cached_piece_entry const& st) = default; cached_piece_entry(cached_piece_entry const&) = default;
cached_piece_entry& operator=(cached_piece_entry const& st) = default; cached_piece_entry& operator=(cached_piece_entry const&) = default;
#endif #endif
bool ok_to_evict(bool ignore_hash = false) const bool ok_to_evict(bool ignore_hash = false) const

View File

@ -512,8 +512,8 @@ namespace libtorrent
virtual const char* what() const TORRENT_EXCEPTION_THROW_SPECIFIER; virtual const char* what() const TORRENT_EXCEPTION_THROW_SPECIFIER;
virtual ~libtorrent_exception() TORRENT_EXCEPTION_THROW_SPECIFIER; virtual ~libtorrent_exception() TORRENT_EXCEPTION_THROW_SPECIFIER;
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
libtorrent_exception(libtorrent_exception const& st) = default; libtorrent_exception(libtorrent_exception const&) = default;
libtorrent_exception& operator=(libtorrent_exception const& st) = default; libtorrent_exception& operator=(libtorrent_exception const&) = default;
#endif #endif
error_code error() const { return m_error; } error_code error() const { return m_error; }
private: private:

View File

@ -61,8 +61,8 @@ namespace libtorrent
// hidden // hidden
~file_entry(); ~file_entry();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
file_entry(file_entry const& st) = default; file_entry(file_entry const&) = default;
file_entry& operator=(file_entry const& st) = default; file_entry& operator=(file_entry const&) = default;
#endif #endif
// the full path of this file. The paths are unicode strings // the full path of this file. The paths are unicode strings

View File

@ -47,8 +47,8 @@ namespace libtorrent
{ {
socket_job() : type(none), vec(NULL), recv_buf(NULL), buf_size(0) {} socket_job() : type(none), vec(NULL), recv_buf(NULL), buf_size(0) {}
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
socket_job(socket_job const& st) = default; socket_job(socket_job const&) = default;
socket_job& operator=(socket_job const& st) = default; socket_job& operator=(socket_job const&) = default;
#endif #endif
enum job_type_t enum job_type_t

View File

@ -52,8 +52,8 @@ namespace libtorrent
{ {
feed_item(); feed_item();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
feed_item(feed_item const& st) = default; feed_item(feed_item const&) = default;
feed_item & operator=(feed_item const& st) = default; feed_item & operator=(feed_item const&) = default;
#endif #endif
~feed_item(); ~feed_item();

View File

@ -126,8 +126,8 @@ namespace libtorrent
session_proxy() {} session_proxy() {}
~session_proxy(); ~session_proxy();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
session_proxy(session_proxy const& st) = default; session_proxy(session_proxy const&) = default;
session_proxy& operator=(session_proxy const& st) = default; session_proxy& operator=(session_proxy const&) = default;
#endif #endif
private: private:
session_proxy( session_proxy(

View File

@ -60,8 +60,8 @@ namespace libtorrent
LIBTORRENT_VERSION); LIBTORRENT_VERSION);
~session_settings(); ~session_settings();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
session_settings(session_settings const& st) = default; session_settings(session_settings const&) = default;
session_settings& operator=(session_settings const& st) = default; session_settings& operator=(session_settings const&) = default;
#endif #endif
// automatically set to the libtorrent version you're using in order to // automatically set to the libtorrent version you're using in order to

View File

@ -253,7 +253,7 @@ namespace libtorrent
{ if (!t.m_torrent.expired()) m_torrent = t.m_torrent; } { if (!t.m_torrent.expired()) m_torrent = t.m_torrent; }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
torrent_handle& operator=(torrent_handle const& st) = default; torrent_handle& operator=(torrent_handle const&) = default;
#endif #endif
// flags for add_piece(). // flags for add_piece().
@ -1261,8 +1261,8 @@ namespace libtorrent
torrent_status(); torrent_status();
~torrent_status(); ~torrent_status();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
torrent_status(torrent_status const& st) = default; torrent_status(torrent_status const&) = default;
torrent_status& operator=(torrent_status const& st) = default; torrent_status& operator=(torrent_status const&) = default;
#endif #endif
// compres if the torrent status objects come from the same torrent. i.e. // compres if the torrent status objects come from the same torrent. i.e.

View File

@ -84,8 +84,8 @@ namespace libtorrent
announce_entry(); announce_entry();
~announce_entry(); ~announce_entry();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
announce_entry(announce_entry const& st) = default; announce_entry(announce_entry const&) = default;
announce_entry& operator=(announce_entry const& st) = default; announce_entry& operator=(announce_entry const&) = default;
#endif #endif
// tracker URL as it appeared in the torrent file // tracker URL as it appeared in the torrent file

View File

@ -295,8 +295,8 @@ private:
magic = 0; magic = 0;
} }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
rootdevice(rootdevice const& st) = default; rootdevice(rootdevice const&) = default;
rootdevice& operator=(rootdevice const& st) = default; rootdevice& operator=(rootdevice const&) = default;
#endif #endif
#endif #endif

View File

@ -1277,7 +1277,9 @@ void block_cache::insert_blocks(cached_piece_entry* pe, int block, file::iovec_t
#endif #endif
if (ret != KERN_SUCCESS || (state & VM_PURGABLE_EMPTY)) if (ret != KERN_SUCCESS || (state & VM_PURGABLE_EMPTY))
{ {
fprintf(stderr, "insert_blocks(piece=%d block=%d): vm_purgable_control failed: %d state & VM_PURGABLE_EMPTY: %d\n" fprintf(stderr, "insert_blocks(piece=%d block=%d):
vm_purgable_control failed: %d state & VM_PURGABLE_EMPTY: %"
PRIx64 "\n"
, pe->piece, block, ret, state & VM_PURGABLE_EMPTY); , pe->piece, block, ret, state & VM_PURGABLE_EMPTY);
free_buffer(pe->blocks[block].buf); free_buffer(pe->blocks[block].buf);
pe->blocks[block].buf = NULL; pe->blocks[block].buf = NULL;
@ -1326,7 +1328,9 @@ bool block_cache::inc_block_refcount(cached_piece_entry* pe, int block, int reas
#endif #endif
if (ret != KERN_SUCCESS || (state & VM_PURGABLE_EMPTY)) if (ret != KERN_SUCCESS || (state & VM_PURGABLE_EMPTY))
{ {
fprintf(stderr, "inc_block_refcount(piece=%d block=%d): vm_purgable_control failed: %d state & VM_PURGABLE_EMPTY: %d\n" fprintf(stderr, "inc_block_refcount(piece=%d block=%d): "
"vm_purgable_control failed: %d state & VM_PURGABLE_EMPTY: %"
PRIx64 "\n"
, pe->piece, block, ret, state & VM_PURGABLE_EMPTY); , pe->piece, block, ret, state & VM_PURGABLE_EMPTY);
free_buffer(pe->blocks[block].buf); free_buffer(pe->blocks[block].buf);
@ -1392,7 +1396,9 @@ void block_cache::dec_block_refcount(cached_piece_entry* pe, int block, int reas
#endif #endif
if (ret != KERN_SUCCESS || (state & VM_PURGABLE_EMPTY)) if (ret != KERN_SUCCESS || (state & VM_PURGABLE_EMPTY))
{ {
fprintf(stderr, "dec_block_refcount(piece=%d block=%d): vm_purgable_control failed: %d state & VM_PURGABLE_EMPTY: %d\n" fprintf(stderr, "dec_block_refcount(piece=%d block=%d): "
"vm_purgable_control failed: %d state & VM_PURGABLE_EMPTY: %"
PRIx64 "\n"
, pe->piece, block, ret, state & VM_PURGABLE_EMPTY); , pe->piece, block, ret, state & VM_PURGABLE_EMPTY);
free_buffer(pe->blocks[block].buf); free_buffer(pe->blocks[block].buf);
pe->blocks[block].buf = NULL; pe->blocks[block].buf = NULL;