3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-03 04:41:22 +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
endif endif
ifeq ($(ENABLE_SOURCE_LOCATION),1)
CXXFLAGS += -DYOSYS_ENABLE_SOURCE_LOCATION
endif
ifeq ($(ENABLE_COVER),1) ifeq ($(ENABLE_COVER),1)
CXXFLAGS += -DYOSYS_ENABLE_COVER CXXFLAGS += -DYOSYS_ENABLE_COVER
endif endif

View file

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