3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-15 03:35:40 +00:00

CMake: integrate backward-cpp

This commit is contained in:
Mohamed Gaber 2026-06-22 18:24:23 +03:00
parent 0e7671c1b3
commit a8142b882f
3 changed files with 14 additions and 19 deletions

View file

@ -45,7 +45,7 @@ set(YOSYS_ABC_EXECUTABLE "" CACHE FILEPATH
option(YOSYS_WITHOUT_ABC "Disable ABC support (not recommended)" OFF)
option(YOSYS_WITHOUT_ZLIB "Disable zlib integration" OFF)
option(YOSYS_WITHOUT_LIBFFI "Disable libffi integration" OFF)
option(YOSYS_WITHOUT_READLINE "Disable readline integration" OFF)
option(YOSYS_WITHOUT_READLINE "Disable readline integration" ON)
option(YOSYS_WITHOUT_EDITLINE "Disable editline integration" OFF)
option(YOSYS_WITHOUT_TCL "Disable Tcl integration" OFF)
option(YOSYS_WITH_PYTHON "Enable Python integration" OFF)

View file

@ -7,3 +7,5 @@ set(YOSYS_VERIFIC_DIR ${PROJECT_SOURCE_DIR}/verific)
set(YOSYS_WITH_PYTHON ON CACHE BOOL "" FORCE)
add_library(verific INTERFACE)
add_subdirectory(${PROJECT_SOURCE_DIR}/libs/backward-cpp)
link_libraries(backward)

View file

@ -1,20 +1,5 @@
{ pkgs ? import <nixpkgs> {} }:
let libs = pkgs.libs;
binutils = pkgs.binutils;
gnu-ar = pkgs.stdenvNoCC.mkDerivation {
# match homebrew name
pname = "gnu-ar";
inherit (binutils) version;
buildInputs = [ binutils ];
phases = ["installPhase"];
installPhase = ''
mkdir -p $out/bin
ln -s ${binutils}/bin/ar $out/bin/gar
'';
};
let lib = pkgs.lib;
in
pkgs.mkShell {
buildInputs = with pkgs; [
@ -37,7 +22,6 @@ pkgs.mkShell {
gperf
autoconf
libdwarf # provides libdwarf.so
libelf # provides libelf.a
doxygen
cudd
zlib
@ -52,5 +36,14 @@ pkgs.mkShell {
];
CMAKE_CXX_COMPILER_LAUNCHER = "ccache";
cmakeFlags = [ "-DCMAKE_C_COMPILER=clang" "-DCMAKE_CXX_COMPILER=clang++" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_CXX_FLAGS=-O0" "-DYOSYS_WITH_PYTHON:BOOL=ON" ];
cmakeFlags = with pkgs; [
"-DCMAKE_C_COMPILER=clang"
"-DCMAKE_CXX_COMPILER=clang++"
"-DCMAKE_BUILD_TYPE=Debug"
"-DCMAKE_CXX_FLAGS=-O0"
"-DYOSYS_WITH_PYTHON:BOOL=ON"
"-DLIBDWARF_INCLUDE_DIR=${lib.getInclude libdwarf}/include"
] ++ lib.optionals stdenv.isLinux [
"-DLIBDW_LIBRARY=${lib.getLib elfutils}/lib/libdw.so"
];
}