瀏覽代碼

add the mingw compile step

Ser Lev Arris 10 年之前
父節點
當前提交
2f372c0ac5
共有 2 個文件被更改,包括 20 次插入0 次删除
  1. 4 0
      .travis.yml
  2. 16 0
      cmake-modules/MinGW_x86_64.cmake

+ 4 - 0
.travis.yml

@@ -35,6 +35,10 @@ install:
 script:
   - if [ $ANDROID ]; then 
     ant -v -Dmy.dir=${TRAVIS_BUILD_DIR} -f ${TRAVIS_BUILD_DIR}/port/jassimp/build.xml ndk-jni ; 
+    elif [ $WINDOWS ]; then
+    cmake -G "Unix Makefiles" -DASSIMP_NO_EXPORT=$TRAVIS_NO_EXPORT -DBUILD_SHARED_LIBS=$SHARED_BUILD -DCMAKE_TOOLCHAIN_FILE=cmake-modules/MinGW_x86_64.cmake ;
+    cmake --build . ;
+    make install ;
     elif [ $RESERVED ]; then
     echo "Reserved condition" ;
     else

+ 16 - 0
cmake-modules/MinGW_x86_64.cmake

@@ -0,0 +1,16 @@
+# this one sets internal to crosscompile (in theory)
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# the minimalistic settings
+SET(CMAKE_C_COMPILER "/usr/bin/x86_64-w64-mingw32-gcc")
+SET(CMAKE_CXX_COMPILER "/usr/bin/x86_64-w64-mingw32-g++")
+SET(CMAKE_RC_COMPILER "/usr/bin/x86_64-w64-mingw32-windres")
+
+# where is the target (so called staging) environment
+SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
+
+# search for programs in the build host directories (default BOTH)
+#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)