aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-09-11 09:46:35 +0100
committerGitHub <noreply@github.com>2019-09-11 09:46:35 +0100
commit927077e03b2e71649a0d691dee8d09bfdf085146 (patch)
tree24313b217c2b42d12b28bbaeb64666d695a83819
parentc0f02563e8908f28aa8eaa5eef2b886c0a27a2ab (diff)
parent0d0056a043510d70a39faa84ec0a0db8684c480b (diff)
downloadnextpnr-927077e03b2e71649a0d691dee8d09bfdf085146.tar.gz
nextpnr-927077e03b2e71649a0d691dee8d09bfdf085146.tar.bz2
nextpnr-927077e03b2e71649a0d691dee8d09bfdf085146.zip
Merge pull request #325 from xobs/ecp5-python-fix
Ecp5 python fixes
-rw-r--r--CMakeLists.txt14
-rw-r--r--ecp5/family.cmake4
2 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77745f95..67b0c18b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,13 @@ if (STATIC_BUILD)
add_definitions(-DBOOST_PYTHON_STATIC_LIB)
endif()
else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".so")
set(link_param "-static")
+ if (BUILD_PYTHON)
+ find_package(ZLIB)
+ find_package(EXPAT)
+ find_package(Threads)
+ endif()
endif()
endif()
@@ -267,6 +273,14 @@ foreach (family ${ARCH})
endif()
if (BUILD_PYTHON)
target_link_libraries(${target} LINK_PUBLIC ${PYTHON_LIBRARIES})
+ if (STATIC_BUILD)
+ target_link_libraries(${target} LINK_PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${ZLIB_LIBRARIES} ${EXPAT_LIBRARIES} -lutil)
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND MSVC)
+ else()
+ target_link_libraries(${target} LINK_PUBLIC -lutil)
+ endif()
+ endif()
endif()
endforeach (target)
endforeach (family)
diff --git a/ecp5/family.cmake b/ecp5/family.cmake
index 596f0924..ec857569 100644
--- a/ecp5/family.cmake
+++ b/ecp5/family.cmake
@@ -41,7 +41,7 @@ if (NOT EXTERNAL_CHIPDB)
set(DEV_CC_BBA_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bba)
set(DEV_CONSTIDS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/constids.inc)
add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
- COMMAND ${ENV_CMD} python3 ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}
+ COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}
DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
)
add_custom_command(OUTPUT ${DEV_CC_DB}
@@ -65,7 +65,7 @@ if (NOT EXTERNAL_CHIPDB)
set(DEV_CC_BBA_DB ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/chipdbs/chipdb-${dev}.bba)
set(DEV_CONSTIDS_INC ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/constids.inc)
add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
- COMMAND ${ENV_CMD} python3 ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}.new
+ COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}.new
COMMAND mv ${DEV_CC_BBA_DB}.new ${DEV_CC_BBA_DB}
DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
)