Browse Source

adding compiling releases for windows 32bit, and linux 32 and 64 bit

Stasik0 10 years ago
parent
commit
bc633e22f1
2 changed files with 36 additions and 4 deletions
  1. 18 4
      .travis.yml
  2. 18 0
      cmake/Toolchain-gcc32.cmake

+ 18 - 4
.travis.yml

@@ -22,7 +22,7 @@ before_install:
    - sudo add-apt-repository ppa:kalakris/cmake -y
    - sudo apt-get update -qq
    - sudo apt-get install -qq gcc-4.8
-   - sudo apt-get install -qq --no-install-recommends build-essential cmake python-lxml graphviz doxygen wget
+   - sudo apt-get install -qq --no-install-recommends build-essential cmake python-lxml graphviz doxygen wget zip
    - wget http://security.ubuntu.com/ubuntu/pool/main/c/check/check_0.9.10-6ubuntu3_amd64.deb
    - sudo dpkg -i check_0.9.10-6ubuntu3_amd64.deb
    - wget https://launchpad.net/ubuntu/+source/liburcu/0.8.5-1ubuntu1/+build/6513813/+files/liburcu2_0.8.5-1ubuntu1_amd64.deb
@@ -38,15 +38,29 @@ script:
    - echo "Testing builds"
    - mkdir -p build
    - cd build
-   - echo "Cross compile build for MinGW"
-   - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake -DEXAMPLESERVER=ON ..
+   - echo "Cross compile release build for MinGW"
+   - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-mingw32.cmake -DCMAKE_BUILD_TYPE=Release -DEXAMPLESERVER=ON ..
    - make -j
+   - zip open62541-win32.zip exampleServer.exe libopen62541.dll libopen62541.a libopen62541.dll.a
+   - cp open62541-win32.zip ..
+   - cd .. && rm build -rf && mkdir -p build && cd build
+   - echo "Cross compile release build for 32-bit linux"
+   - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-gcc32.cmake -DCMAKE_BUILD_TYPE=Release -DEXAMPLESERVER=ON ..
+   - make -j
+   - tar -pczf open62541-linux32.tar.gz exampleServer libopen62541.so libopen62541.a
+   - cp open62541-linux32.tar.gz ..
+   - cd .. && rm build -rf && mkdir -p build && cd build
+   - echo "Compile release build for 64-bit linux"
+   - cmake -DCMAKE_BUILD_TYPE=Release -DEXAMPLESERVER=ON ..
+   - make -j
+   - tar -pczf open62541-linux64.tar.gz exampleServer libopen62541.so libopen62541.a
+   - cp open62541-linux64.tar.gz ..
    - cd .. && rm build -rf && mkdir -p build && cd build
    - echo "Compile multithreaded version"
    - cmake -DMULTITHREADING=ON -DEXAMPLESERVER=ON ..
    - make -j
    - cd .. && rm build -rf && mkdir -p build && cd build
-   - echo "Production build"
+   - echo "Documentation build"
    - cmake -DEXAMPLESERVER=ON -DEXTENSION_STATELESS=ON -DGENERATE_DOCUMENTATION=ON .. 
    - make -j
    - echo "Generate documentation"

+ 18 - 0
cmake/Toolchain-gcc32.cmake

@@ -0,0 +1,18 @@
+# the name of the target operating system
+set(CMAKE_SYSTEM_NAME Linux)
+
+# which compilers to use for C and C++
+set(CMAKE_C_COMPILER gcc)
+set(CMAKE_C_FLAGS -m32)
+set(CMAKE_CXX_COMPILER g++)
+set(CMAKE_CXX_FLAGS -m32)
+
+# here is the target environment located
+set(CMAKE_FIND_ROOT_PATH   /usr/i486-linux-gnu )
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)