3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-16 13:58:47 +00:00

source_location: Auto detect library

Drop `ENABLE_SOURCE_LOCATION` flag.
This commit is contained in:
Krystine Sherwin 2025-03-21 10:26:11 +13:00
parent 343758371d
commit 2575f87381
No known key found for this signature in database
2 changed files with 9 additions and 7 deletions

View file

@ -519,10 +519,6 @@ LIBS_VERIFIC += -Wl,--whole-archive $(patsubst %,$(VERIFIC_DIR)/%/*-linux.a,$(VE
endif
endif
ifeq ($(ENABLE_SOURCE_LOCATION),1)
CXXFLAGS += -DYOSYS_ENABLE_SOURCE_LOCATION
endif
ifeq ($(ENABLE_COVER),1)
CXXFLAGS += -DYOSYS_ENABLE_COVER
endif

View file

@ -23,10 +23,15 @@
#include "kernel/yosys_common.h"
#include "kernel/yosys.h"
#ifdef YOSYS_ENABLE_SOURCE_LOCATION
#include <experimental/source_location>
using std::experimental::source_location;
#include <version>
#if __cpp_lib_source_location == 201907L
#include <source_location>
using std::source_location;
#else
#include <experimental/source_location>
# ifdef __cpp_lib_experimental_source_location
using std::experimental::source_location;
# else
struct source_location { // dummy placeholder
int line() const { return 0; }
int column() const { return 0; }
@ -34,6 +39,7 @@ struct source_location { // dummy placeholder
const char* function_name() const { return "unknown"; }
static const source_location current(...) { return source_location(); }
};
# endif
#endif
YOSYS_NAMESPACE_BEGIN