diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-08-16 10:32:34 +0200 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-08-16 10:32:34 +0200 |
commit | 8965922219ea55ffd15ad5f4bbf7641330e03a27 (patch) | |
tree | ca6e542a1f21ee2b2110a38aead1c0d16f495394 | |
parent | 2e02f2d6166c75b1fcec73d268e97e407071a372 (diff) | |
download | nextpnr-8965922219ea55ffd15ad5f4bbf7641330e03a27.tar.gz nextpnr-8965922219ea55ffd15ad5f4bbf7641330e03a27.tar.bz2 nextpnr-8965922219ea55ffd15ad5f4bbf7641330e03a27.zip |
Added ability for static builds
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | README.md | 7 |
2 files changed, 15 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() @@ -127,6 +127,13 @@ cmake -DARCH=ice40 -DCMAKE_BUILD_TYPE=Debug -DBUILD_PYTHON=OFF -DBUILD_GUI=OFF - make -j$(nproc) ``` +To make static build relase for iCE40 architecture use the following: + +``` +cmake -DARCH=ice40 -DBUILD_PYTHON=OFF -DBUILD_GUI=OFF -DSTATIC_BUILD=ON . +make -j$(nproc) +``` + Notes for developers -------------------- |