summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/asic/CMakeLists.txt17
-rw-r--r--src/lib/ip/CMakeLists.txt17
2 files changed, 34 insertions, 0 deletions
diff --git a/src/lib/asic/CMakeLists.txt b/src/lib/asic/CMakeLists.txt
index eb3c9e5..a6aca5c 100644
--- a/src/lib/asic/CMakeLists.txt
+++ b/src/lib/asic/CMakeLists.txt
@@ -26,3 +26,20 @@ add_library(asic OBJECT
vegam.c
verde.c
)
+
+if(MSVC)
+ # force static runtime libraries for msvc builds.
+ # The DK's boost is using the static RTL and if we
+ # don't use the same RTL version we get link errors.
+ set(variables
+ CMAKE_C_FLAGS_DEBUG
+ CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_C_FLAGS_MINSIZEREL
+ )
+ foreach(variable ${variables})
+ if(${variable} MATCHES "/MD")
+ string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
+ endif()
+ endforeach()
+ endif() \ No newline at end of file
diff --git a/src/lib/ip/CMakeLists.txt b/src/lib/ip/CMakeLists.txt
index 5daa785..03b3dab 100644
--- a/src/lib/ip/CMakeLists.txt
+++ b/src/lib/ip/CMakeLists.txt
@@ -64,3 +64,20 @@ add_library(ip OBJECT
vce40.c
vcn10.c
)
+
+if(MSVC)
+ # force static runtime libraries for msvc builds.
+ # The DK's boost is using the static RTL and if we
+ # don't use the same RTL version we get link errors.
+ set(variables
+ CMAKE_C_FLAGS_DEBUG
+ CMAKE_C_FLAGS_RELEASE
+ CMAKE_C_FLAGS_RELWITHDEBINFO
+ CMAKE_C_FLAGS_MINSIZEREL
+ )
+ foreach(variable ${variables})
+ if(${variable} MATCHES "/MD")
+ string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
+ endif()
+ endforeach()
+ endif() \ No newline at end of file