diff --git a/.github/workflows/Linux-clang.yml b/.github/workflows/Linux-clang.yml new file mode 100644 index 00000000..4a5698c7 --- /dev/null +++ b/.github/workflows/Linux-clang.yml @@ -0,0 +1,30 @@ +name: "Linux Clang" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + BUILD_TYPE: Release + CXX: clang++-9 + +jobs: + job: + name: "Linux Clang" + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Configure + run: mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=../bin .. + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build diff --git a/.github/workflows/Linux-gcc.yml b/.github/workflows/Linux-gcc.yml new file mode 100644 index 00000000..85689d13 --- /dev/null +++ b/.github/workflows/Linux-gcc.yml @@ -0,0 +1,30 @@ +name: "Linux GCC" + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + BUILD_TYPE: Release + CXX: g++-9 + +jobs: + job: + name: "Linux GCC" + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Configure + run: mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=../bin .. + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml new file mode 100644 index 00000000..d31d1767 --- /dev/null +++ b/.github/workflows/Windows.yml @@ -0,0 +1,27 @@ +name: Windows + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + job: + name: Windows + runs-on: windows-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Configure + run: mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=../bin .. + - name: Build + run: cmake --build build + # - name: Install + # run: cmake --install build + diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml new file mode 100644 index 00000000..02ef6304 --- /dev/null +++ b/.github/workflows/macOS.yml @@ -0,0 +1,29 @@ +name: macOS + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + BUILD_TYPE: Release + +jobs: + job: + name: macOS + runs-on: macos-latest + strategy: + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - name: Configure + run: mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=../bin .. + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build diff --git a/CMakeLists.txt b/CMakeLists.txt index 83f10670..80877636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ # @author Frank Gaede, DESY # @author Jan Engels, DESY # @author Remi Ete, DESY -CMAKE_MINIMUM_REQUIRED( VERSION 2.8 FATAL_ERROR ) +CMAKE_MINIMUM_REQUIRED( VERSION 3.4 FATAL_ERROR ) ######################################################## # project name @@ -18,6 +18,8 @@ SET( SIO_VERSION_PATCH 2 ) LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ) +SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) + # options OPTION( SIO_EXAMPLES "Switch ON to build SIO examples" ON ) OPTION( INSTALL_DOC "Set to OFF to skip build/install Documentation" OFF ) diff --git a/cmake/SIOBuild.cmake b/cmake/SIOBuild.cmake index 222a236f..1f5ca610 100644 --- a/cmake/SIOBuild.cmake +++ b/cmake/SIOBuild.cmake @@ -289,5 +289,7 @@ ENDFOREACH() IF( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 ) SET( CMAKE_CXX_FLAGS "-fdiagnostics-color=auto ${CMAKE_CXX_FLAGS}" ) ENDIF() - +IF( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + SET( CMAKE_CXX_FLAGS "/permissive- ${CMAKE_CXX_FLAGS}" ) +ENDIF() INSTALL( FILES cmake/MacroCheckPackageLibs.cmake cmake/MacroCheckPackageVersion.cmake DESTINATION lib/cmake ) diff --git a/source/include/sio/api.h b/source/include/sio/api.h index 16a99d76..8dacd666 100644 --- a/source/include/sio/api.h +++ b/source/include/sio/api.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace sio { diff --git a/source/include/sio/definitions.h b/source/include/sio/definitions.h index b2921445..7116c1c2 100644 --- a/source/include/sio/definitions.h +++ b/source/include/sio/definitions.h @@ -9,6 +9,9 @@ #include #include #include +#ifdef _WIN32 +#define NOMINMAX +#endif #ifdef __APPLE__ #include <_types.h> #include <_types/_uint16_t.h>