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

Fix windows compilation #259

Merged
merged 5 commits into from
Nov 26, 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
42 changes: 25 additions & 17 deletions cmake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,25 +150,33 @@ macro(dune_probe_cxx)
if(DUNE_CXX_MICROSOFT)
set(DUNE_CXX_NAME "Microsoft")

if(MSVC60)
# https://learn.microsoft.com/en-us/cpp/overview/compiler-versions
# https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html
if(MSVC_VERSION EQUAL 1200)
message(FATAL_ERROR "Visual Studio 6.0 is not supported")
elseif(MSVC14)
set(msv_version "2015")
elseif(MSVC12)
set(msv_version "2013")
elseif(MSVC11)
set(msv_version "2012")
elseif(MSVC10)
set(msv_version "2010")
elseif(MSVC90)
set(msv_version "2008")
elseif(MSVC80)
set(msv_version "2005")
elseif(MSVC71)
set(msv_version "2003")
elseif(MSVC70)
elseif(MSVC_VERSION EQUAL 1300)
set(msv_version "2002")
endif(MSVC60)
elseif(MSVC_VERSION EQUAL 1310)
set(msv_version "2003")
elseif(MSVC_VERSION EQUAL 1400)
set(msv_version "2005")
elseif(MSVC_VERSION EQUAL 1500)
set(msv_version "2008")
elseif(MSVC_VERSION EQUAL 1600)
set(msv_version "2010")
elseif(MSVC_VERSION EQUAL 1700)
set(msv_version "2012")
elseif(MSVC_VERSION EQUAL 1800)
set(msv_version "2013")
elseif(MSVC_VERSION EQUAL 1900)
set(msv_version "2015")
elseif(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
set(msv_version "2017")
elseif(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
set(msv_version "2019")
elseif(MSVC_VERSION GREATER_EQUAL 1930)
set(msv_version "2022")
endif()

set(DUNE_CXX_CANONICAL "vs${msv_version}")
set(DUNE_CXX_FLAGS "${DUNE_CXX_FLAGS} /wd4251 /wd4244 /wd4267 /wd4800 /wd4805 /wd4305 /wd4244 /wd4996")
Expand Down
3 changes: 2 additions & 1 deletion programs/tests/test_AtomicInteger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

using namespace DUNE::Concurrency;

static constexpr int thread_num = 10;

class TestIncrement: public Thread
{
private:
Expand All @@ -65,7 +67,6 @@ main(void)

AtomicInteger aint(0);
long target = 10000;
int thread_num = 10;

TestIncrement* tests[thread_num];
for (int i = 0; i < thread_num; i++)
Expand Down
5 changes: 4 additions & 1 deletion src/Sensors/VantagePro2/Parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ namespace Sensors
#ifdef __GNUC__
struct __attribute__((__packed__)) LOOPData
#elif defined(_MSC_VER)
__pragma(pack(push, 1)) struct LOOPData __pragma(pack(pop))
__pragma(pack(push, 1)) struct LOOPData
#endif
{
uint8_t Ack; // Acknowledge char
Expand Down Expand Up @@ -151,6 +151,9 @@ namespace Sensors
uint8_t CR; // '\r' 0x0d
uint16_t WCRC; // CRC check bytes (CCITT-16 standard) 2bytes
};
#if defined(_MSC_VER)
__pragma(pack(pop))
#endif

//! DAVIS' LOOP data packet data.
LOOPData m_LOOPData;
Expand Down
28 changes: 16 additions & 12 deletions src/Vision/PointGrey/Task.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
if(DUNE_SYS_HAS___ARM_ARCH_7A__)
if(POINTGREY)
if(DUNE_SYS_HAS___ARM_ARCH_7A__)
if(NOT DUNE_SYS_HAS_OPENCV)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_OPENCV)

if(NOT DUNE_SYS_HAS_OPENCV)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_OPENCV)

if(NOT DUNE_SYS_HAS_EXIV2)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_EXIV2)
if(NOT DUNE_SYS_HAS_EXIV2)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_EXIV2)

if(NOT DUNE_SYS_HAS_FLYCAPTURE)
if(NOT DUNE_SYS_HAS_FLYCAPTURE)
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_FLYCAPTURE)
elseif(DUNE_OS_WINDOWS)
set(TASK_ENABLED FALSE)
endif(DUNE_SYS_HAS___ARM_ARCH_7A__)
else()
set(TASK_ENABLED FALSE)
endif(NOT DUNE_SYS_HAS_FLYCAPTURE)

endif(DUNE_SYS_HAS___ARM_ARCH_7A__)
endif(POINTGREY)

set(TASK_LICENSE "Proprietary")
Loading