Michael Ragazzon 6 лет назад
Родитель
Сommit
fd793828a1
5 измененных файлов с 82 добавлено и 3 удалено
  1. 62 0
      .travis.yml
  2. 7 1
      Build/CMakeLists.txt
  3. 3 1
      Include/Rocket/Core/Vector3.inl
  4. 3 1
      Include/Rocket/Core/Vector4.inl
  5. 7 0
      readme.md

+ 62 - 0
.travis.yml

@@ -0,0 +1,62 @@
+sudo: false
+dist: trusty
+
+matrix:
+  include:
+    - os: osx
+      osx_image: xcode8.3
+      env: ARCH=OSX
+      language: c++
+      compiler: clang
+    - os: linux
+      language: c++
+      compiler: clang
+      env: ARCH=x86_64 CC=clang
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+            - llvm-toolchain-trusty-6.0
+          packages:
+            - clang-6.0
+            - cmake
+            - build-essential
+            - libboost-dev
+            - libboost-python-dev
+            - libsdl2-dev
+            - libsdl2-image-dev
+            - libfreetype6-dev
+            - libsfml-dev
+            - liblua5.2-dev
+    - os: linux
+      language: c++
+      compiler: gcc
+      env: ARCH=x86_64 CC=gcc
+      addons:
+        apt:
+          sources:
+            - ubuntu-toolchain-r-test
+          packages:
+            - g++-7
+            - cmake
+            - build-essential
+            - libboost-dev
+            - libboost-python-dev
+            - libsdl2-dev
+            - libsdl2-image-dev
+            - libfreetype6-dev
+            - libsfml-dev
+            - liblua5.2-dev
+
+install:
+  - if [[ "$CC" == "clang" ]]; then export CC=clang-6.0 CXX=clang++-6.0; fi
+  - if [[ "$CC" == "gcc" ]]; then export CC=gcc-7 CXX=g++-7; fi
+  - cd "$TRAVIS_BUILD_DIR/Build"
+  - if [[ "$ARCH" == "x86_64" ]]; then cmake -D BUILD_PYTHON_BINDINGS=ON -DBUILD_LUA_BINDINGS=ON -DBUILD_SAMPLES=ON .; fi
+  - if [[ "$ARCH" == "OSX" ]]; then cmake -G Xcode .; fi
+  - cd "$TRAVIS_BUILD_DIR"
+
+script:
+  - cd Build
+  - if [[ "$ARCH" == "x86_64" ]]; then make -j4; fi
+  - if [[ "$ARCH" == "OSX" ]]; then xcodebuild -project librocket.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD; fi

+ 7 - 1
Build/CMakeLists.txt

@@ -368,6 +368,9 @@ if(BUILD_PYTHON_BINDINGS)
 
 
         set_target_properties(${NAME} PROPERTIES PREFIX "")
         set_target_properties(${NAME} PROPERTIES PREFIX "")
 
 
+        set_property(TARGET ${NAME} PROPERTY CXX_STANDARD 17)
+        set_property(TARGET ${NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+
         install(TARGETS ${NAME}
         install(TARGETS ${NAME}
                 EXPORT libRocketTargets
                 EXPORT libRocketTargets
                 LIBRARY DESTINATION ${PYTHON_INSTDIR}
                 LIBRARY DESTINATION ${PYTHON_INSTDIR}
@@ -392,7 +395,10 @@ if(BUILD_LUA_BINDINGS)
                            VERSION ${PROJECT_VERSION}
                            VERSION ${PROJECT_VERSION}
                            SOVERSION ${LIBROCKET_VERSION_MAJOR}
                            SOVERSION ${LIBROCKET_VERSION_MAJOR}
         )
         )
-        
+
+        set_property(TARGET ${NAME} PROPERTY CXX_STANDARD 17)
+        set_property(TARGET ${NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
+
         install(TARGETS ${NAME}
         install(TARGETS ${NAME}
             EXPORT libRocketTargets
             EXPORT libRocketTargets
             LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
             LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

+ 3 - 1
Include/Rocket/Core/Vector3.inl

@@ -25,6 +25,8 @@
  *
  *
  */
  */
 
 
+#include <type_traits>
+
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
 
 
@@ -65,7 +67,7 @@ Type Vector3< Type >::SquaredMagnitude() const
 template < typename Type >
 template < typename Type >
 Vector3< Type > Vector3< Type >::Normalise() const
 Vector3< Type > Vector3< Type >::Normalise() const
 {
 {
-	ROCKET_STATIC_ASSERT(false, Invalid_Operation);
+	ROCKET_STATIC_ASSERT(std::is_floating_point< Type >::value, Invalid_Operation);
 	return *this;
 	return *this;
 }
 }
 
 

+ 3 - 1
Include/Rocket/Core/Vector4.inl

@@ -25,6 +25,8 @@
  *
  *
  */
  */
 
 
+#include <type_traits>
+
 namespace Rocket {
 namespace Rocket {
 namespace Core {
 namespace Core {
 
 
@@ -70,7 +72,7 @@ Type Vector4< Type >::SquaredMagnitude() const
 template < typename Type >
 template < typename Type >
 Vector4< Type > Vector4< Type >::Normalise() const
 Vector4< Type > Vector4< Type >::Normalise() const
 {
 {
-	ROCKET_STATIC_ASSERT(false, Invalid_Operation);
+	ROCKET_STATIC_ASSERT(std::is_floating_point< Type >::value, Invalid_Operation);
 	return *this;
 	return *this;
 }
 }
 
 

+ 7 - 0
readme.md

@@ -1,5 +1,7 @@
 # libRocket - The HTML/CSS User Interface Library
 # libRocket - The HTML/CSS User Interface Library
 
 
+[![Build Status][travis-badge]][travis-url]
+
 Documentation at https://barotto.github.io/libRocketDoc/
 Documentation at https://barotto.github.io/libRocketDoc/
 
 
 
 
@@ -265,3 +267,8 @@ this, you don't have to learn a whole new proprietary technology like other libr
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  LIABILITY, WHETHER 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
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  THE SOFTWARE.
  THE SOFTWARE.
+
+
+
+[travis-badge]: https://travis-ci.org/mikke89/libRocket.svg?branch=master
+[travis-url]: https://travis-ci.org/mikke89/libRocket