From 9e572eca3e2d0ccda7d97207075138ac23b06b6d Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 25 Mar 2018 16:45:29 +0200 Subject: [PATCH 01/11] Added clang for travis --- .travis.yml | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71a096c..08cc19c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,23 +10,32 @@ # sudo: false - -os: - - linux +language: cpp env: - - CXX_STANDARD=c++98 BRANCH_TO_TEST=boost-1.58.0 - - CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.58.0 - - CXX_STANDARD=c++98 BRANCH_TO_TEST=boost-1.59.0 - - CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.59.0 - - CXX_STANDARD=c++98 BRANCH_TO_TEST=master - - CXX_STANDARD=c++11 BRANCH_TO_TEST=master - - CXX_STANDARD=c++14 BRANCH_TO_TEST=master - CXX_STANDARD=c++17 BRANCH_TO_TEST=master + - CXX_STANDARD=c++14 BRANCH_TO_TEST=master + - CXX_STANDARD=c++11 BRANCH_TO_TEST=master + - CXX_STANDARD=c++98 BRANCH_TO_TEST=master + - CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.58.0 + - CXX_STANDARD=c++98 BRANCH_TO_TEST=boost-1.58.0 + - CXX_STANDARD=c++11 BRANCH_TO_TEST=boost-1.59.0 + - CXX_STANDARD=c++98 BRANCH_TO_TEST=boost-1.59.0 + +compiler: + - clang + - gcc addons: apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-precise packages: + - gcc-5 + - g++-5 + - clang-5.0 + - lld-5.0 - xsltproc - docbook-xsl - docbook-xml @@ -35,6 +44,9 @@ before_install: - DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl - DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 + - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 + - gcc --version + # Set this to the name of your Boost library # Autodetect library name by using the following code: - PROJECT_TO_TEST=$(basename $(pwd)) - PROJECT_TO_TEST=$(basename $(pwd)) @@ -57,7 +69,7 @@ script: - cd $PROJECT_DIR/build - export BOOST_ROOT=$BOOST # `--coverage` flags required to generate coverage info for Coveralls - - ./build.sh "cxxflags=-std=$CXX_STANDARD --coverage" "linkflags=--coverage" + - ./build.sh --toolset=$CC "cxxflags=-std=$CXX_STANDARD -Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations --coverage" "--coverage" after_success: - COVERALS_DIR=$PROJECT_DIR/coverals From b8e8b6ffbf8ccc2471ff426807c7fe455e9ede17 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 25 Mar 2018 17:02:58 +0200 Subject: [PATCH 02/11] Fixed uncaught_exceptions usage with clang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason clang seems so believe uncaught_exceptions does not belong to the std namespace: no member named 'uncaught_exceptions' in namespace 'std'; did you mean simply 'uncaught_exceptions'? I haven't found any indication confirming this, but let's just support both… --- include/turtle/config.hpp | 2 +- include/turtle/detail/function.hpp | 5 +++-- include/turtle/detail/function_impl_template.hpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/turtle/config.hpp b/include/turtle/config.hpp index 96a11c8..16b0ed5 100644 --- a/include/turtle/config.hpp +++ b/include/turtle/config.hpp @@ -94,7 +94,7 @@ # endif #endif -#if defined(__cplusplus) && (__cplusplus >= 201703L) || \ +#if defined(__cpp_lib_uncaught_exceptions) || \ defined(_MSC_VER) && (_MSC_VER >= 1900) # ifndef MOCK_NO_UNCAUGHT_EXCEPTIONS # define MOCK_UNCAUGHT_EXCEPTIONS diff --git a/include/turtle/detail/function.hpp b/include/turtle/detail/function.hpp index a631310..7432384 100644 --- a/include/turtle/detail/function.hpp +++ b/include/turtle/detail/function.hpp @@ -87,10 +87,11 @@ namespace detail E* e_; }; - inline int uncaught_exceptions() + inline int exceptions() { #ifdef MOCK_UNCAUGHT_EXCEPTIONS - return std::uncaught_exceptions(); + using namespace std; + return uncaught_exceptions(); #else return std::uncaught_exception() ? 1 : 0; #endif diff --git a/include/turtle/detail/function_impl_template.hpp b/include/turtle/detail/function_impl_template.hpp index 2a8d74a..4e322db 100644 --- a/include/turtle/detail/function_impl_template.hpp +++ b/include/turtle/detail/function_impl_template.hpp @@ -43,12 +43,12 @@ namespace detail function_impl() : context_( 0 ) , valid_( true ) + , exceptions_( exceptions() ) , mutex_( boost::make_shared< mutex >() ) - , exceptions_( uncaught_exceptions() ) {} virtual ~function_impl() { - if( valid_ && exceptions_ >= uncaught_exceptions() ) + if( valid_ && exceptions_ >= exceptions() ) for( expectations_cit it = expectations_.begin(); it != expectations_.end(); ++it ) if( ! it->verify() ) From a178fc442af982b9657a7236697a9af8ff25478e Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 25 Mar 2018 20:05:27 +0200 Subject: [PATCH 03/11] Removed stdcall tests and examples for all compilers but msvc --- doc/example/reference.cpp | 57 --------------------------------------- test/test_mock.cpp | 4 +-- 2 files changed, 1 insertion(+), 60 deletions(-) diff --git a/doc/example/reference.cpp b/doc/example/reference.cpp index 9dbad31..bb2c4d6 100644 --- a/doc/example/reference.cpp +++ b/doc/example/reference.cpp @@ -249,16 +249,6 @@ MOCK_CLASS( mock_class ) }; //] } -#elif defined( BOOST_GCC ) -namespace member_function_example_10 -{ -//[ member_function_example_10 -MOCK_CLASS( mock_class ) -{ - MOCK_METHOD( __attribute((stdcall)) method, 0, void(), method ) // all parameters must be provided when specifying a different calling convention -}; -//] -} #endif namespace static_member_function_example_1 @@ -292,16 +282,6 @@ MOCK_CLASS( mock_class ) }; //] } -#elif defined( BOOST_GCC ) -namespace static_member_function_example_4 -{ -//[ static_member_function_example_4 -MOCK_CLASS( mock_class ) -{ - MOCK_STATIC_METHOD( __attribute((stdcall)) method, 0, void(), method ) // all parameters must be provided when specifying a different calling convention -}; -//] -} #endif namespace constructor_example_1 @@ -336,16 +316,6 @@ MOCK_CLASS( mock_class ) }; //] } -#elif defined( BOOST_GCC ) -namespace constructor_example_4 -{ -//[ constructor_example_4 -MOCK_CLASS( mock_class ) -{ - MOCK_CONSTRUCTOR( __attribute((stdcall)) mock_class, 0, (), constructor ) -}; -//] -} #endif namespace destructor_example_1 @@ -368,16 +338,6 @@ MOCK_CLASS( mock_class ) }; //] } -#elif defined( BOOST_GCC ) -namespace destructor_example_3 -{ -//[ destructor_example_3 -MOCK_CLASS( mock_class ) -{ - MOCK_DESTRUCTOR( __attribute((stdcall)) ~mock_class, destructor ) -}; -//] -} #endif namespace conversion_operator_example_1 @@ -414,16 +374,6 @@ MOCK_CLASS( mock_class ) }; //] } -#elif defined( BOOST_GCC ) -namespace conversion_operator_example_4 -{ -//[ conversion_operator_example_4 -MOCK_CLASS( mock_class ) -{ - MOCK_CONVERSION_OPERATOR( __attribute((stdcall)) operator, int, conversion_to_int ) -}; -//] -} #endif namespace function_example_1 @@ -445,13 +395,6 @@ namespace function_example_2 MOCK_FUNCTION( __stdcall f, 0, void(), f ) // all parameters must be provided when specifying a different calling convention //] } -#elif defined( BOOST_GCC ) -namespace function_example_3 -{ -//[ function_example_3 -MOCK_FUNCTION( __attribute((stdcall)) f, 0, void(), f ) // all parameters must be provided when specifying a different calling convention -//] -} #endif namespace functor_example_1 diff --git a/test/test_mock.cpp b/test/test_mock.cpp index 98b148b..9eff85b 100644 --- a/test/test_mock.cpp +++ b/test/test_mock.cpp @@ -433,11 +433,9 @@ namespace #ifdef BOOST_MSVC # define MOCK_STDCALL __stdcall -#elif defined( BOOST_GCC ) -# define MOCK_STDCALL __attribute((stdcall)) #else # define MOCK_STDCALL -#endif // BOOST_GCC +#endif namespace stdcall { From 71a7f6d9c43cc5f78c32a07177fb944cc5902e9b Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 25 Mar 2018 20:25:08 +0200 Subject: [PATCH 04/11] Fixed shell build script to exit upon error --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index 7791769..d42daf7 100755 --- a/build/build.sh +++ b/build/build.sh @@ -12,7 +12,7 @@ copy() cp $@ } -set -x +set -ex export BOOST=$BOOST_ROOT From 35b4f570aefe67491b4ff9695f3b918100889e10 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Thu, 29 Mar 2018 15:09:50 +0200 Subject: [PATCH 05/11] Fixed clang warning --- include/turtle/constraints.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/turtle/constraints.hpp b/include/turtle/constraints.hpp index 780f37f..5433874 100644 --- a/include/turtle/constraints.hpp +++ b/include/turtle/constraints.hpp @@ -22,7 +22,7 @@ namespace mock { - MOCK_UNARY_CONSTRAINT( any, 0,, true && &actual ) + MOCK_UNARY_CONSTRAINT( any, 0,, ((void)actual, true) ) MOCK_UNARY_CONSTRAINT( affirm, 0,, !! actual ) MOCK_UNARY_CONSTRAINT( negate, 0,, ! actual ) MOCK_UNARY_CONSTRAINT( evaluate, 0,, actual() ) From caef00d2e315cda0697ebf79c4bade888aa9b17d Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Thu, 29 Mar 2018 15:10:42 +0200 Subject: [PATCH 06/11] Fixed move in actions for gcc --- include/turtle/detail/action.hpp | 8 +++++++- include/turtle/detail/function_impl_template.hpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/turtle/detail/action.hpp b/include/turtle/detail/action.hpp index 8c49633..ed055d2 100644 --- a/include/turtle/detail/action.hpp +++ b/include/turtle/detail/action.hpp @@ -109,11 +109,17 @@ namespace detail { this->set( boost::bind( - &boost::move< BOOST_RV_REF(Value) >, + &move< Value >, boost::ref( store( boost::move( v ) ) ) ) ); } private: + template< typename T > + static T&& move( T& t ) + { + return std::move( t ); + } + struct value : boost::noncopyable { virtual ~value() diff --git a/include/turtle/detail/function_impl_template.hpp b/include/turtle/detail/function_impl_template.hpp index 4e322db..4d47a82 100644 --- a/include/turtle/detail/function_impl_template.hpp +++ b/include/turtle/detail/function_impl_template.hpp @@ -183,9 +183,9 @@ namespace detail this->e_->throws( t ); } template< typename TT > - void moves( TT t ) + void moves( BOOST_RV_REF(TT) t ) { - this->e_->moves( t ); + this->e_->moves( boost::move( t ) ); } lock lock_; From 4455222a62e8880ee6718847db76362880ccbd70 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Thu, 29 Mar 2018 15:39:15 +0200 Subject: [PATCH 07/11] Removed support for directly mocking a protected member function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Taking a function pointer on a base member protected function is actually invalid. This could work with a pointer on the derived class member function, that is &derived::method instead of &base::method however there is no way to pass the derived class from MOCK_BASE_CLASS to the mock::detail::base helper if template classes are to be supported. Anyway the now documented workaround is simple enough and the same as for private member functions. As a side note the changes from ed36823235ce1d0d847ee3d180ede9b3cdc00df8 might not be needed any more… --- ....cpp => limitations_protected_private_method.cpp} | 11 +++++++---- doc/limitations.qbk | 9 +++++---- include/turtle/mock.hpp | 12 ++++-------- test/test_integration.cpp | 8 ++++---- test/test_mock.cpp | 5 ++--- 5 files changed, 22 insertions(+), 23 deletions(-) rename doc/example/{limitations_private_method.cpp => limitations_protected_private_method.cpp} (62%) diff --git a/doc/example/limitations_private_method.cpp b/doc/example/limitations_protected_private_method.cpp similarity index 62% rename from doc/example/limitations_private_method.cpp rename to doc/example/limitations_protected_private_method.cpp index b03c086..327cf2a 100644 --- a/doc/example/limitations_private_method.cpp +++ b/doc/example/limitations_protected_private_method.cpp @@ -12,18 +12,21 @@ namespace { -//[ limitations_private_method_problem +//[ limitations_protected_private_method_problem class base { private: - virtual void method() = 0; + virtual void method_1() = 0; + private: + virtual void method_2() = 0; }; //] -//[ limitations_private_method_solution +//[ limitations_protected_private_method_solution MOCK_BASE_CLASS( mock_base, base ) { - MOCK_METHOD( method, 0, void() ) + MOCK_METHOD( method_1, 0, void() ) + MOCK_METHOD( method_2, 0, void() ) }; //] } diff --git a/doc/limitations.qbk b/doc/limitations.qbk index e128b74..ece78fd 100644 --- a/doc/limitations.qbk +++ b/doc/limitations.qbk @@ -11,7 +11,7 @@ [import example/limitations_non_virtual_method.cpp] [import example/limitations_template_base_class_method.cpp] [import example/limitations_template_method.cpp] -[import example/limitations_private_method.cpp] +[import example/limitations_protected_private_method.cpp] [import example/limitations_comma_in_macro.cpp] [import example/limitations_const_parameter_warning.cpp] @@ -116,18 +116,19 @@ A workaround would be to add the signature to MOCK_METHOD : Given : -[limitations_private_method_problem] +[limitations_protected_private_method_problem] the following code does not compile : MOCK_BASE_CLASS( mock_base, base ) { - MOCK_METHOD( method, 0 ) // this fails because 'method' is not visible + MOCK_METHOD( method_1, 0 ) // this fails because a function pointer on 'base::method_1' is not allowed + MOCK_METHOD( method_2, 0 ) // this fails because 'method_2' is not visible }; A workaround would be to add the signature to MOCK_METHOD : -[limitations_private_method_solution] +[limitations_protected_private_method_solution] [endsect] diff --git a/include/turtle/mock.hpp b/include/turtle/mock.hpp index 78fb185..e92f458 100644 --- a/include/turtle/mock.hpp +++ b/include/turtle/mock.hpp @@ -43,8 +43,8 @@ #else // MOCK_VARIADIC_MACROS -#define MOCK_BASE_CLASS(T, B) \ - struct T : B, mock::object, mock::detail::base< B > +#define MOCK_BASE_CLASS(T, I) \ + struct T : I, mock::object, mock::detail::base< I > #define MOCK_FUNCTOR(f, S) \ mock::detail::functor< MOCK_FUNCTION_TYPE((S),) > f, f##_mock @@ -177,11 +177,8 @@ #define MOCK_VARIADIC_ELEM_1(e0, e1, ...) e1 #define MOCK_VARIADIC_ELEM_2(e0, e1, e2, ...) e2 -#define MOCK_METHOD_SIGNATURE(M, n, S, t) \ - typedef MOCK_FUNCTION_TYPE((S),) BOOST_PP_CAT(t,_sig_type); \ - MOCK_METHOD_EXT(M, n, BOOST_PP_CAT(t,_sig_type), t) #define MOCK_METHOD(M, ...) \ - MOCK_METHOD_SIGNATURE(M, \ + MOCK_METHOD_EXT(M, \ MOCK_VARIADIC_ELEM_0(__VA_ARGS__ ), \ MOCK_VARIADIC_ELEM_1(__VA_ARGS__, MOCK_SIGNATURE(M)), \ MOCK_VARIADIC_ELEM_2(__VA_ARGS__, M, M)) @@ -228,8 +225,7 @@ #else // MOCK_VARIADIC_MACROS #define MOCK_METHOD(M, n) \ - typedef MOCK_SIGNATURE(M) M##_sig_type; \ - MOCK_METHOD_EXT(M, n, M##_sig_type, M) + MOCK_METHOD_EXT(M, n, MOCK_SIGNATURE(M), M) #define MOCK_FUNCTION(F, n, S, t) \ MOCK_FUNCTION_AUX(F, n, S, t, inline,) diff --git a/test/test_integration.cpp b/test/test_integration.cpp index 7636e47..d1b7567 100644 --- a/test/test_integration.cpp +++ b/test/test_integration.cpp @@ -84,8 +84,8 @@ namespace class my_ambiguited_interface : boost::noncopyable { public: - virtual ~my_ambiguited_interface() {} - + virtual ~my_ambiguited_interface() + {} virtual void my_method() = 0; virtual void my_method( int ) = 0; }; @@ -110,8 +110,8 @@ namespace class my_const_ambiguited_interface : boost::noncopyable { public: - virtual ~my_const_ambiguited_interface() {} - + virtual ~my_const_ambiguited_interface() + {} virtual void my_method() = 0; virtual void my_method() const = 0; }; diff --git a/test/test_mock.cpp b/test/test_mock.cpp index 9eff85b..60838c2 100644 --- a/test/test_mock.cpp +++ b/test/test_mock.cpp @@ -364,7 +364,7 @@ namespace { virtual ~base() {} - protected: + virtual void m1() = 0; }; @@ -413,7 +413,7 @@ namespace { virtual ~base() {} - protected: + virtual void m1() = 0; }; @@ -444,7 +444,6 @@ namespace stdcall virtual ~base() {} - protected: virtual void MOCK_STDCALL m1() = 0; }; From 20e7d50568e2b0a4dd37bfcdedf73c20eaefaf40 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 1 Apr 2018 12:20:00 +0200 Subject: [PATCH 08/11] Fixed test failing for gcc --- test/detail/test_signature.cpp | 4 ++-- test/test_mock.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/detail/test_signature.cpp b/test/detail/test_signature.cpp index afe9ba4..27f4e91 100644 --- a/test/detail/test_signature.cpp +++ b/test/detail/test_signature.cpp @@ -23,7 +23,7 @@ namespace BOOST_AUTO_TEST_CASE( mock_signature_generates_signature ) { BOOST_MPL_ASSERT(( - boost::is_same< void(), MOCK_SIGNATURE( method_1 ) > )); + boost::is_same< void(), MOCK_SIGNATURE(method_1) > )); BOOST_MPL_ASSERT(( - boost::is_same< float( int ), MOCK_SIGNATURE( method_2 ) > )); + boost::is_same< float( int ), MOCK_SIGNATURE(method_2) > )); } diff --git a/test/test_mock.cpp b/test/test_mock.cpp index 60838c2..3aa7473 100644 --- a/test/test_mock.cpp +++ b/test/test_mock.cpp @@ -384,7 +384,7 @@ namespace template< typename T > MOCK_BASE_CLASS( variadic_tpl, base ) { - MOCK_METHOD( m1, 0 ) + MOCK_METHOD( m1, 0, void() ) MOCK_METHOD_TPL( m2, 0, T() ) MOCK_METHOD_TPL( m3, 0, T(), m3 ) MOCK_CONST_METHOD_TPL( m4, 0, T() ) @@ -425,7 +425,7 @@ namespace template< typename T > MOCK_BASE_CLASS( derived_tpl, base ) { - MOCK_METHOD( m1, 0 ) + MOCK_METHOD_EXT( m1, 0, void(), m1 ) }; } From a2647d00e91e65c4c5d3d746423903c7b12c3580 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 1 Apr 2018 16:27:38 +0200 Subject: [PATCH 09/11] Fixed gcc build error --- doc/example/patterns_invoke_functor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/example/patterns_invoke_functor.cpp b/doc/example/patterns_invoke_functor.cpp index a7e0676..f4d281d 100644 --- a/doc/example/patterns_invoke_functor.cpp +++ b/doc/example/patterns_invoke_functor.cpp @@ -14,7 +14,7 @@ namespace class base_class { public: - virtual void method( boost::function< void( int ) > functor ) = 0; + virtual void method( const boost::function< void( int ) >& functor ) = 0; }; void function( base_class& ); // the function will call 'method' with a functor to be applied From 6a68fa728b1968860772951fb8d97f6f2917e130 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 1 Apr 2018 16:32:16 +0200 Subject: [PATCH 10/11] Fixed shell build script --- build/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index d42daf7..a525c9e 100755 --- a/build/build.sh +++ b/build/build.sh @@ -28,5 +28,5 @@ copy "$BOOST"/doc/src/boostbook.css ../doc/html copy "$BOOST"/doc/src/images/*.png ../doc/html/images copy "$BOOST"/doc/src/images/callouts/*.png ../doc/html/images/callouts cd ../doc -$BOOST/b2 -q "$C" +$BOOST/b2 -q "$@" cd ../build From 47784f992efb13b6e50665b5ec4e66756b1c2f32 Mon Sep 17 00:00:00 2001 From: Mathieu Champlon Date: Sun, 8 Apr 2018 07:04:01 +0200 Subject: [PATCH 11/11] Added docker files for gcc and clang development environments --- .gitattributes | 1 + build/build.bat | 4 ++-- build/build.xml | 11 ----------- build/clang/Dockerfile | 17 +++++++++++++++++ build/gcc/Dockerfile | 9 +++++++++ 5 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 .gitattributes create mode 100644 build/clang/Dockerfile create mode 100644 build/gcc/Dockerfile diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfdb8b7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh text eol=lf diff --git a/build/build.bat b/build/build.bat index f88b5a0..2ae058b 100644 --- a/build/build.bat +++ b/build/build.bat @@ -11,7 +11,7 @@ rem error if BOOST_ROOT not set set BOOST=%BOOST_ROOT% pushd ..\test -%BOOST%\b2 -q %* +%BOOST%\b2.exe -q %* popd if errorlevel 1 exit /b %ERRORLEVEL% @@ -24,6 +24,6 @@ xcopy /Y /S /Q /I %BOOST%\doc\src\images\*.png ..\doc\html\images xcopy /Y /S /Q /I %BOOST%\doc\src\images\callouts\*.png ..\doc\html\images\callouts if errorlevel 1 exit /b %ERRORLEVEL% pushd ..\doc -%BOOST%\b2 -q %* +%BOOST%\b2.exe -q %* popd if errorlevel 1 exit /b %ERRORLEVEL% diff --git a/build/build.xml b/build/build.xml index f5fcdaa..b2201f8 100644 --- a/build/build.xml +++ b/build/build.xml @@ -18,17 +18,6 @@ - - - - - - - - - - - diff --git a/build/clang/Dockerfile b/build/clang/Dockerfile new file mode 100644 index 0000000..fd3a65b --- /dev/null +++ b/build/clang/Dockerfile @@ -0,0 +1,17 @@ +# $ docker build --platform=linux -f clang/Dockerfile -t turtle-clang . +FROM buildpack-deps:stretch +RUN apt-get update && apt-get install -y xsltproc docbook-xsl docbook-xml && apt-get autoremove && apt-get clean +ENV DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl \ + DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 \ + BOOST_ROOT=/home/dev/cpp/boost/ +# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add - && \ +RUN echo "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch-5.0 main" >> /etc/apt/sources.list && \ + apt-get update && \ + apt-get install -y --allow-unauthenticated clang-5.0 lld-5.0 libc++1 && \ + apt-get autoremove && \ + apt-get clean && \ + update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 100 && \ + update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 100 +RUN echo 'cd /home/dev/cpp/turtle/build' >> ~/.bashrc +# $ docker run --platform=linux --rm -v C:/dev:/home/dev -m 32g -it turtle-clang +# ./build.sh --toolset=clang "cxxflags=-std=c++17 -stdlib=libc++ -Wno-unused-variable" diff --git a/build/gcc/Dockerfile b/build/gcc/Dockerfile new file mode 100644 index 0000000..5d1a4d8 --- /dev/null +++ b/build/gcc/Dockerfile @@ -0,0 +1,9 @@ +# $ docker build -f Dockerfile -t turtle-gcc . +FROM gcc +RUN apt-get update && apt-get install -y xsltproc docbook-xsl docbook-xml && apt-get autoremove && apt-get clean +ENV DOCBOOK_XSL_DIR=/usr/share/xml/docbook/stylesheet/docbook-xsl \ + DOCBOOK_DTD_DIR=/usr/share/xml/docbook/schema/dtd/4.2 \ + BOOST_ROOT=/home/dev/cpp/boost/ +RUN echo 'cd /home/dev/cpp/turtle/build' >> ~/.bashrc +# $ docker run --platform=linux --rm -v C:/dev:/home/dev -m 16g -it turtle-gcc +# ./build.sh --toolset=gcc "cxxflags=-std=c++17 -Wno-noexcept-type -Wno-unused-variable -Wno-unused-function -Wno-deprecated-declarations"