diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
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) |