aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-04-14 10:14:51 +0100
committergatecat <gatecat@ds0.me>2021-04-14 10:30:19 +0100
commit4e346ecfba86880c2528e3463b9beb42932d8567 (patch)
tree37c620946f8dda1937ba1fa4b6ce6f0e2126c4ea /CMakeLists.txt
parent2912860c9788033a7501726e77bb4962b394280d (diff)
downloadnextpnr-4e346ecfba86880c2528e3463b9beb42932d8567.tar.gz
nextpnr-4e346ecfba86880c2528e3463b9beb42932d8567.tar.bz2
nextpnr-4e346ecfba86880c2528e3463b9beb42932d8567.zip
Hash table refactoring
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 538ad1a4..8291a21f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,7 @@ option(EXTERNAL_CHIPDB "Create build with pre-built chipdb binaries" OFF)
option(WERROR "pass -Werror to compiler (used for CI)" OFF)
option(PROFILER "Link against libprofiler" OFF)
option(USE_IPO "Compile nextpnr with IPO" ON)
+option(USE_ABSEIL "Compile nextpnr with Abseil for faster hash map" OFF)
if (USE_IPO)
if (ipo_supported)
@@ -198,7 +199,7 @@ if (NOT DEFINED CURRENT_GIT_VERSION)
)
endif()
-if (NOT WASI)
+if (USE_ABSEIL)
add_subdirectory(3rdparty/abseil-cpp EXCLUDE_FROM_ALL)
endif()
@@ -251,7 +252,10 @@ else()
endif()
set(EXTRA_LIB_DEPS)
-if (USE_THREADS)
+if (USE_ABSEIL)
+ if (NOT USE_THREADS)
+ message(FATAL_ERROR "Abseil without threads is not supported")
+ endif()
list(APPEND EXTRA_LIB_DEPS absl::flat_hash_map)
list(APPEND EXTRA_LIB_DEPS absl::flat_hash_set)
endif()
@@ -332,6 +336,9 @@ foreach (family ${ARCH})
target_compile_definitions(${target} PRIVATE QT_NO_KEYWORDS)
target_link_libraries(${target} LINK_PUBLIC gui_${family} ${GUI_LIBRARY_FILES_${ufamily}})
endif()
+ if (USE_ABSEIL)
+ target_compile_definitions(${target} PRIVATE USE_ABSEIL)
+ endif()
if (BUILD_PYTHON)
target_link_libraries(${target} LINK_PUBLIC ${PYTHON_LIBRARIES})
if (STATIC_BUILD)