summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMok <Siupak.Mok@amd.com>2019-03-28 10:21:47 -0400
committerTom St Denis <tom.stdenis@amd.com>2019-03-29 07:12:01 -0400
commita00932ad5c6a18481fd7e090e6e4abada87c8d8d (patch)
treec67ed1eb742dcacaab57a7d679e0b21a12e2d57d
parent42ed76e43e76acedd5bd1f631040a956ac9d9879 (diff)
Adding Windows portion of CMake file for asic and ip lib
Signed-off-by: Mok <Siupak.Mok@amd.com> Reviewed-by: Tom St Denis <tom.stdenis@amd.com>
-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