From ce6621b985cadc5a5073e12e49b0ca8f10bb2096 Mon Sep 17 00:00:00 2001 From: Catherine Date: Wed, 27 May 2026 08:31:58 +0000 Subject: [PATCH] Drop `YOSYS_ENABLE_HELP_SOURCE` since C++20 is required. --- .github/workflows/prepare-docs.yml | 1 - .github/workflows/test-build.yml | 1 - CMakeLists.txt | 1 - kernel/register.h | 32 +++++++++--------------------- kernel/yosys_config.h.in | 1 - 5 files changed, 9 insertions(+), 27 deletions(-) diff --git a/.github/workflows/prepare-docs.yml b/.github/workflows/prepare-docs.yml index e13ff2f1e..ff2b96872 100644 --- a/.github/workflows/prepare-docs.yml +++ b/.github/workflows/prepare-docs.yml @@ -62,7 +62,6 @@ jobs: echo 'set(CMAKE_CXX_COMPILER clang++ CACHE STRING "")' >> Configuration.cmake echo 'set(YOSYS_COMPILER_LAUNCHER ccache CACHE STRING "")' >> Configuration.cmake echo 'set(YOSYS_VERIFIC_DIR "/usr/local/src/verific_lib" CACHE STRING "")' >> Configuration.cmake - echo 'set(YOSYS_ENABLE_HELP_SOURCE ON CACHE BOOL "")' >> Configuration.cmake cmake -C Configuration.cmake -B build . cmake --build build -j$procs diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 79af6cd7b..e09fd9eb3 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -261,7 +261,6 @@ jobs: echo 'set(CMAKE_C_COMPILER clang CACHE STRING "")' >> Configuration.cmake echo 'set(CMAKE_CXX_COMPILER clang++ CACHE STRING "")' >> Configuration.cmake echo 'set(YOSYS_COMPILER_LAUNCHER ccache CACHE STRING "")' >> Configuration.cmake - echo 'set(YOSYS_ENABLE_HELP_SOURCE ON CACHE BOOL "")' >> Configuration.cmake cmake -C Configuration.cmake -B build . cmake --build build -j$procs diff --git a/CMakeLists.txt b/CMakeLists.txt index 3864fb883..bc04f5ee2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -290,7 +290,6 @@ condition(YOSYS_ENABLE_EDITLINE editline_FOUND AND NOT YOSYS_WITHOUT_EDITLINE AN condition(YOSYS_ENABLE_TCL tcl_FOUND AND libtommath_FOUND AND NOT YOSYS_WITHOUT_TCL) condition(YOSYS_ENABLE_PYTHON Python3Embed_FOUND AND PyosysEnv_FOUND AND YOSYS_WITH_PYTHON) condition(YOSYS_ENABLE_VERIFIC YOSYS_VERIFIC_DIR AND zlib_FOUND) -condition(YOSYS_ENABLE_HELP_SOURCE NOT CMAKE_BUILD_TYPE MATCHES "^(Release|RelWithDebInfo)$") # Describe dependencies and features # CMake 4.0 would let us use proper conditions, but that's too new for now. diff --git a/kernel/register.h b/kernel/register.h index 78f9b430d..0e0069293 100644 --- a/kernel/register.h +++ b/kernel/register.h @@ -23,29 +23,15 @@ #include "kernel/yosys_common.h" #include "kernel/yosys.h" -#ifdef YOSYS_ENABLE_HELP_SOURCE - #include -# if __cpp_lib_source_location == 201907L - #include - using std::source_location; - #define HAS_SOURCE_LOCATION -# elif defined(__has_include) -# if __has_include() - #include - using std::experimental::source_location; - #define HAS_SOURCE_LOCATION -# endif -# endif -#endif - -#ifndef HAS_SOURCE_LOCATION -struct source_location { // dummy placeholder - int line() const { return 0; } - int column() const { return 0; } - const char* file_name() const { return "unknown"; } - const char* function_name() const { return "unknown"; } - static const source_location current(...) { return source_location(); } -}; +#include +#if __cpp_lib_source_location >= 201907L + #include + using std::source_location; +#elif defined(__has_include) + #if __has_include() + #include + using std::experimental::source_location; + #endif #endif YOSYS_NAMESPACE_BEGIN diff --git a/kernel/yosys_config.h.in b/kernel/yosys_config.h.in index 2596bc0e5..d0d6ce6ff 100644 --- a/kernel/yosys_config.h.in +++ b/kernel/yosys_config.h.in @@ -17,6 +17,5 @@ #cmakedefine YOSYS_ENABLE_TCL #cmakedefine YOSYS_ENABLE_PYTHON #cmakedefine YOSYS_ENABLE_VERIFIC -#cmakedefine YOSYS_ENABLE_HELP_SOURCE #endif