Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HW]: Fix some issues when compiling with MinGW #503

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 additions & 15 deletions hardware_integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,31 @@ if("WindowsInnoMakerUSB2CAN" IN_LIST CAN_DRIVER)
set(CMAKE_SYSTEM_PROCESSOR ${MSVC_CXX_ARCHITECTURE_ID})
endif()

message(STATUS "Target Arch: ${CMAKE_SYSTEM_PROCESSOR}")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL
"x64")
message(STATUS "Detected AMD64, linking to INNOMAKER USB2CAN x64 Library")
target_link_libraries(
HardwareIntegration
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/lib/Windows/InnoMakerUsb2CanLib64.lib)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR
STREQUAL "X86")
message(STATUS "Detected x86, linking to INNOMAKER USB2CAN x86 Library")
target_link_libraries(
HardwareIntegration
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/lib/Windows/InnoMakerUsb2CanLib32.lib)
else()
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND MINGW)
message(
FATAL_ERROR
"Windows InnoMaker USB2CAN Selected but no supported processor arch was detected. Only x64 and x86 are supported."
"The InnoMaker driver is compatible only with MSVC, and won't work with mingw"
)
else()
message(STATUS "Target Arch: ${CMAKE_SYSTEM_PROCESSOR}")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" OR CMAKE_SYSTEM_PROCESSOR
STREQUAL "x64")
message(STATUS "Detected AMD64, linking to INNOMAKER USB2CAN x64 Library")
target_link_libraries(
HardwareIntegration
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/lib/Windows/InnoMakerUsb2CanLib64.lib)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR
STREQUAL "X86")
message(STATUS "Detected x86, linking to INNOMAKER USB2CAN x86 Library")
target_link_libraries(
HardwareIntegration
PRIVATE ${CMAKE_CURRENT_LIST_DIR}/lib/Windows/InnoMakerUsb2CanLib32.lib)
else()
message(
FATAL_ERROR
"Windows InnoMaker USB2CAN Selected but no supported processor arch was detected. Only x64 and x86 are supported."
)
endif()
endif()
endif()

Expand Down
2 changes: 2 additions & 0 deletions hardware_integration/src/sys_tec_windows_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "isobus/hardware_integration/sys_tec_windows_plugin.hpp"
#include "isobus/isobus/can_stack_logger.hpp"

#include <thread>

namespace isobus
{
SysTecWindowsPlugin::SysTecWindowsPlugin(std::uint8_t channel, std::uint32_t baudrate) :
Expand Down
Loading