File tree Expand file tree Collapse file tree 5 files changed +29
-9
lines changed Expand file tree Collapse file tree 5 files changed +29
-9
lines changed Original file line number Diff line number Diff line change 3030 - os : ubuntu-latest
3131 c_compiler : clang
3232 cpp_compiler : clang++
33- exclude :
3433 - os : windows-latest
3534 c_compiler : cl
35+ cpp_compiler : cl
36+ exclude :
3637 - os : windows-latest
3738 c_compiler : gcc
3839 - os : windows-latest
6768 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
6869 -DMODBUS_EXAMPLE=ON
6970 -DMODBUS_TESTS=ON
70- -DMODBUS_COMMUNICATION=${{ matrix.os == 'windows-latest' && 'OFF' || matrix.os == 'ubuntu-latest' && 'ON' }}
71+ -DMODBUS_TCP_COMMUNICATION=${{ matrix.os == 'windows-latest' && 'OFF' || matrix.os == 'ubuntu-latest' && 'ON' }}
72+ -DMODBUS_SERIAL_COMMUNICATION=${{ matrix.os == 'windows-latest' && 'OFF' || matrix.os == 'ubuntu-latest' && 'ON' }}
7173 -S ${{ github.workspace }}
7274
7375 - name : Build
Original file line number Diff line number Diff line change 3030* .exe
3131* .out
3232* .app
33-
3433build
3534
35+ # Windows specific
36+ out
37+ .vs
38+
3639# Gtags
3740GTAGS
3841GRTAGS
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.13)
2- project (protocolConverter )
2+ project (modbus )
33
44set (CMAKE_CXX_STANDARD 17)
55
@@ -11,7 +11,14 @@ endif()
1111
1212option (MODBUS_EXAMPLE "Build example program" OFF )
1313option (MODBUS_TESTS "Build tests" OFF )
14- option (MODBUS_COMMUNICATION "Use Modbus communication library" ON )
14+ option (MODBUS_TCP_COMMUNICATION "Use Modbus TCP communication library" ON )
15+
16+ if (NOT win32 )
17+ # Serial not supported on Windows
18+ option (MODBUS_SERIAL_COMMUNICATION "Use Modbus serial communication library" OFF ) # not supported by windows platform
19+ else ()
20+ message (STATUS "Modbus Serial not supported on Windows." )
21+ endif ()
1522
1623add_subdirectory (src)
1724
Original file line number Diff line number Diff line change @@ -23,10 +23,14 @@ target_include_directories(Modbus_Core PUBLIC ${PROJECT_SOURCE_DIR}/include PRIV
2323add_library (Modbus)
2424target_link_libraries (Modbus Modbus_Core)
2525
26+ if (MODBUS_SERIAL_COMMUNICATION)
27+ message (STATUS "Enabling Modbus Serial" )
28+ add_subdirectory (Serial)
29+ target_link_libraries (Modbus Modbus_Serial)
30+ endif ()
2631
27- if (MODBUS_COMMUNICATION )
28- message (" Modbus communication is experimental " )
32+ if (MODBUS_TCP_COMMUNICATION )
33+ message (STATUS "Enabling Modbus Serial " )
2934 add_subdirectory (TCP)
30- add_subdirectory (Serial)
31- target_link_libraries (Modbus Modbus_TCP Modbus_Serial)
35+ target_link_libraries (Modbus Modbus_TCP)
3236endif ()
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ project(Google_tests)
22add_subdirectory (googletest)
33include_directories (${gtest_SOURCE_DIR} /include ${gtest_SOURCE_DIR} )
44
5+ if (MSVC )
6+ set (gtest_force_shared_crt on )
7+ endif ()
8+
59set (TestFiles MB/ModbusRequestTests.cpp
610 MB/ModbusResponseTests.cpp
711 MB/ModbusExceptionTests.cpp
You can’t perform that action at this time.
0 commit comments