Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/base/main/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <misc/util/abc_global.h>

#include <stdio.h>

ABC_NAMESPACE_IMPL_START

int Abc_RealMain(int argc, char *argv[]);
Expand All @@ -8,5 +10,6 @@ ABC_NAMESPACE_IMPL_END

int main(int argc, char *argv[])
{
setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
return ABC_NAMESPACE_PREFIX Abc_RealMain(argc, argv);
}
63 changes: 33 additions & 30 deletions tools/sn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,44 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

get_filename_component(ABC_DEFAULT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../.." ABSOLUTE)
set(ABC_SOURCE_DIR "${ABC_DEFAULT_SOURCE_DIR}" CACHE PATH "ABC source directory")
set(SLANG_SOURCE_DIR "" CACHE PATH "Existing Slang checkout; empty downloads the pinned revision")
set(SLANG_REVISION "43028607069b954beaf3f5afd5a73016957c0162" CACHE STRING "Pinned Slang revision")
if(NOT EXISTS "${ABC_SOURCE_DIR}/src/base/sn/sn.h")
message(FATAL_ERROR "ABC_SOURCE_DIR must contain src/base/sn/sn.h")
endif()

set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_TOOLS OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_TESTS OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_INSTALL OFF CACHE BOOL "" FORCE)
set(SLANG_USE_MIMALLOC OFF CACHE BOOL "" FORCE)
# Use explicit URLs: this Slang revision otherwise derives a prefix from the
# caller's Git remote, which is unavailable in source archives and some builds.
include(FetchContent)
FetchContent_Declare(fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 12.2.0 GIT_SHALLOW ON SYSTEM EXCLUDE_FROM_ALL)
FetchContent_Declare(boost_regex GIT_REPOSITORY https://github.com/MikePopoloski/regex.git
GIT_TAG boost-1.91.0 GIT_SHALLOW ON SOURCE_SUBDIR _no_build_)
FetchContent_Declare(tomlplusplus GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.4.0 GIT_SHALLOW ON FIND_PACKAGE_ARGS 3.4)
if(SLANG_SOURCE_DIR)
if(NOT EXISTS "${SLANG_SOURCE_DIR}/include/slang/ast/Compilation.h")
message(FATAL_ERROR "SLANG_SOURCE_DIR is not a SystemVerilog Slang checkout")
endif()
add_subdirectory("${SLANG_SOURCE_DIR}" slang EXCLUDE_FROM_ALL)
else()
if(NOT TARGET slang::slang)
set(SLANG_SOURCE_DIR "" CACHE PATH "Existing Slang checkout; empty downloads the pinned revision")
set(SLANG_REVISION "43028607069b954beaf3f5afd5a73016957c0162" CACHE STRING "Pinned Slang revision")

set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_TOOLS OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_TESTS OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SLANG_INCLUDE_INSTALL OFF CACHE BOOL "" FORCE)
set(SLANG_USE_MIMALLOC OFF CACHE BOOL "" FORCE)
# Use explicit URLs: this Slang revision otherwise derives a prefix from the
# caller's Git remote, which is unavailable in source archives and some builds.
include(FetchContent)
FetchContent_Declare(slang
GIT_REPOSITORY https://github.com/MikePopoloski/slang.git
GIT_TAG ${SLANG_REVISION}
PATCH_COMMAND ${CMAKE_COMMAND}
-DSLANG_SOURCE_DIR=<SOURCE_DIR>
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/patchSlangGitProbe.cmake")
FetchContent_MakeAvailable(slang)
FetchContent_Declare(fmt GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 12.2.0 GIT_SHALLOW ON SYSTEM EXCLUDE_FROM_ALL)
FetchContent_Declare(boost_regex GIT_REPOSITORY https://github.com/MikePopoloski/regex.git
GIT_TAG boost-1.91.0 GIT_SHALLOW ON SOURCE_SUBDIR _no_build_)
FetchContent_Declare(tomlplusplus GIT_REPOSITORY https://github.com/marzer/tomlplusplus.git
GIT_TAG v3.4.0 GIT_SHALLOW ON FIND_PACKAGE_ARGS 3.4)
if(SLANG_SOURCE_DIR)
if(NOT EXISTS "${SLANG_SOURCE_DIR}/include/slang/ast/Compilation.h")
message(FATAL_ERROR "SLANG_SOURCE_DIR is not a SystemVerilog Slang checkout")
endif()
add_subdirectory("${SLANG_SOURCE_DIR}" slang EXCLUDE_FROM_ALL)
else()
include(FetchContent)
FetchContent_Declare(slang
GIT_REPOSITORY https://github.com/MikePopoloski/slang.git
GIT_TAG ${SLANG_REVISION}
PATCH_COMMAND ${CMAKE_COMMAND}
-DSLANG_SOURCE_DIR=<SOURCE_DIR>
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/patchSlangGitProbe.cmake")
FetchContent_MakeAvailable(slang)
endif()
endif()

add_library(sn_slang_lib STATIC src/snSlang.cpp)
Expand Down
Loading