aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2019-08-15 10:59:42 +0200
committerGitHub <noreply@github.com>2019-08-15 10:59:42 +0200
commita6a4349bd6ec9531937944a45fc0807c63057221 (patch)
tree152bf56cbbef2e78e044401d3f5cee76006b597e /CMakeLists.txt
parent541451dc623e550aa9a41bbf3326ab537be2fa4e (diff)
parentace5ad09f860b3e9beb1fe085acf6ea357c53512 (diff)
downloadnextpnr-a6a4349bd6ec9531937944a45fc0807c63057221.tar.gz
nextpnr-a6a4349bd6ec9531937944a45fc0807c63057221.tar.bz2
nextpnr-a6a4349bd6ec9531937944a45fc0807c63057221.zip
Merge pull request #314 from xobs/fix-windows-static
cmake: fix static build on Windows
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c58104de..f662dbe7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,14 @@ option(SERIALIZE_CHIPDB "Never build chipdb in parallel to reduce peak memory us
set(link_param "")
if (STATIC_BUILD)
set(Boost_USE_STATIC_LIBS ON)
- if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND MSVC)
+ set(CMAKE_CXX_FLAGS_RELEASE "/MT")
+ set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
+ if (BUILD_PYTHON)
+ add_definitions(-DBOOST_PYTHON_STATIC_LIB)
+ endif()
+ else()
set(link_param "-static")
endif()
endif()