diff --git a/3rdparty/QtPropertyBrowser/src/CMakeLists.txt b/3rdparty/QtPropertyBrowser/src/CMakeLists.txt index ad67f6f7..83717cbe 100644 --- a/3rdparty/QtPropertyBrowser/src/CMakeLists.txt +++ b/3rdparty/QtPropertyBrowser/src/CMakeLists.txt @@ -39,7 +39,9 @@ add_library(${TARGET_NAME} STATIC ${_QRC_SRCS} ) -target_compile_options(${TARGET_NAME} PRIVATE -Wno-deprecated-declarations) +if (NOT MSVC) + target_compile_options(${TARGET_NAME} PRIVATE -Wno-deprecated-declarations) +endif() if (MSVC) target_compile_options(${TARGET_NAME} PRIVATE /wd4457 /wd4718) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6584b23c..83fca6ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,10 @@ endif() cmake_minimum_required(VERSION 3.25) project(nextpnr CXX) +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") +endif() + set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) include(CheckCXXCompilerFlag) diff --git a/common/kernel/command.cc b/common/kernel/command.cc index 3de407ac..17d1c818 100644 --- a/common/kernel/command.cc +++ b/common/kernel/command.cc @@ -191,36 +191,21 @@ void init_share_dirname() { npnr_share_dirname = "/share/"; } void init_share_dirname() { std::string proc_self_path = proc_self_dirname(); -#if defined(_WIN32) && !defined(nextpnr_WIN32_UNIX_DIR) - std::string proc_share_path = proc_self_path + "share\\"; - if (check_file_exists(proc_share_path, true)) { - npnr_share_dirname = proc_share_path; - return; - } - proc_share_path = proc_self_path + "..\\share\\" + "nextpnr\\"; - if (check_file_exists(proc_share_path, true)) { - npnr_share_dirname = proc_share_path; - return; - } -#else - std::string proc_share_path = proc_self_path + "share/"; - if (check_file_exists(proc_share_path, true)) { - npnr_share_dirname = proc_share_path; - return; - } - proc_share_path = proc_self_path + "../share/" + "nextpnr/"; - if (check_file_exists(proc_share_path, true)) { - npnr_share_dirname = proc_share_path; - return; - } + + for (const std::string &proc_share_path : { + proc_self_path + "share/", + proc_self_path + "../share/nextpnr/", + proc_self_path + "../share/", #ifdef nextpnr_DATDIR - proc_share_path = nextpnr_DATDIR "/"; - if (check_file_exists(proc_share_path, true)) { - npnr_share_dirname = proc_share_path; - return; + nextpnr_DATDIR "/", +#endif + }) + { + if (check_file_exists(proc_share_path, true)) { + npnr_share_dirname = proc_share_path; + return; + } } -#endif -#endif } #endif diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index d8b9f897..eb628e7d 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -59,6 +59,7 @@ target_include_directories(nextpnr-${target}-gui PRIVATE ${CMAKE_SOURCE_DIR}/3rdparty/QtPropertyBrowser/src ${CMAKE_SOURCE_DIR}/3rdparty/imgui ${CMAKE_SOURCE_DIR}/3rdparty/qtimgui + Boost::headers ) if (Qt6_FOUND) @@ -74,6 +75,7 @@ target_link_libraries(nextpnr-${target}-gui PRIVATE nextpnr_version QtPropertyBrowser pybind11::headers + ${Boost_LIBRARIES} ) # Currently always the case when the GUI is built. diff --git a/himbaechel/uarch/gatemate/pack_bram.cc b/himbaechel/uarch/gatemate/pack_bram.cc index 8650c067..4622c756 100644 --- a/himbaechel/uarch/gatemate/pack_bram.cc +++ b/himbaechel/uarch/gatemate/pack_bram.cc @@ -88,26 +88,19 @@ uint8_t GateMatePacker::ram_clk_signal(CellInfo *cell, IdString port) int width_to_config(int width) { - switch (width) { - case 0: - return 0; - case 1: - return 1; - case 2: - return 2; - case 3 ... 5: + if (width < 3) + return width; + if (width < 6) return 3; - case 6 ... 10: + if (width < 11) return 4; - case 11 ... 20: + if (width < 21) return 5; - case 21 ... 40: + if (width < 41) return 6; - case 41 ... 80: + if (width < 81) return 7; - default: - log_error("Unsupported width '%d'.\n", width); - } + log_error("Unsupported width '%d'.\n", width); } static void rename_or_move(CellInfo *main, CellInfo *other, IdString port, IdString other_port) diff --git a/himbaechel/uarch/gatemate/route_clock.cc b/himbaechel/uarch/gatemate/route_clock.cc index 188d1b1e..14c57575 100644 --- a/himbaechel/uarch/gatemate/route_clock.cc +++ b/himbaechel/uarch/gatemate/route_clock.cc @@ -19,6 +19,7 @@ #include #include +#include #include "gatemate.h" #include "log.h"