3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-12 06:00:55 +00:00

Add and use ENABLE_HELP_SOURCE

Conditionally include help source tracking to preserve ABI.
Docs builds can (and should) use `ENABLE_HELP_SOURCE` so that the generated sphinx docs can perform default grouping and link to source files.
Regular user-builds don't need the source tracking.
This commit is contained in:
Krystine Sherwin 2025-08-06 13:52:13 +12:00
parent 7fe4ae45fd
commit 891a907a30
No known key found for this signature in database
4 changed files with 26 additions and 14 deletions

View file

@ -23,22 +23,22 @@
#include "kernel/yosys_common.h"
#include "kernel/yosys.h"
#include <version>
#if __cpp_lib_source_location == 201907L
#include <source_location>
using std::source_location;
#elif defined(__has_include)
# if __has_include(<experimental/source_location>)
#include <experimental/source_location>
using std::experimental::source_location;
# else
#define SOURCE_FALLBACK
# endif
#else
#define SOURCE_FALLBACK
#ifdef YOSYS_ENABLE_HELP_SOURCE
#include <version>
# if __cpp_lib_source_location == 201907L
#include <source_location>
using std::source_location;
#define HAS_SOURCE_LOCATION
# elif defined(__has_include)
# if __has_include(<experimental/source_location>)
#include <experimental/source_location>
using std::experimental::source_location;
#define HAS_SOURCE_LOCATION
# endif
# endif
#endif
#ifdef SOURCE_FALLBACK
#ifndef HAS_SOURCE_LOCATION
struct source_location { // dummy placeholder
int line() const { return 0; }
int column() const { return 0; }