aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-08-16 10:32:34 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-08-16 10:32:34 +0200
commit8965922219ea55ffd15ad5f4bbf7641330e03a27 (patch)
treeca6e542a1f21ee2b2110a38aead1c0d16f495394 /CMakeLists.txt
parent2e02f2d6166c75b1fcec73d268e97e407071a372 (diff)
downloadnextpnr-8965922219ea55ffd15ad5f4bbf7641330e03a27.tar.gz
nextpnr-8965922219ea55ffd15ad5f4bbf7641330e03a27.tar.bz2
nextpnr-8965922219ea55ffd15ad5f4bbf7641330e03a27.zip
Added ability for static builds
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 4c222d71..0cf55eb8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,13 @@ project(nextpnr)
option(BUILD_GUI "Build GUI" ON)
option(BUILD_PYTHON "Build Python Integration" ON)
option(BUILD_TESTS "Build GUI" OFF)
+option(STATIC_BUILD "Create static build" OFF)
+
+set(link_param "")
+if (STATIC_BUILD)
+ set(Boost_USE_STATIC_LIBS ON)
+ set(link_param "-static")
+endif()
# List of families to build
set(FAMILIES generic ice40 ecp5)
@@ -211,7 +218,7 @@ foreach (family ${ARCH})
# Include family-specific source files to all family targets and set defines appropriately
target_include_directories(${target} PRIVATE ${family}/ ${CMAKE_CURRENT_BINARY_DIR}/generated/)
target_compile_definitions(${target} PRIVATE NEXTPNR_NAMESPACE=nextpnr_${family} ARCH_${ufamily} ARCHNAME=${family})
- target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES})
+ target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${link_param})
if (NOT MSVC)
target_link_libraries(${target} LINK_PUBLIC pthread)
endif()