mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
source_location: Auto detect library
Drop `ENABLE_SOURCE_LOCATION` flag.
This commit is contained in:
parent
343758371d
commit
2575f87381
2 changed files with 9 additions and 7 deletions
4
Makefile
4
Makefile
|
@ -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
|
||||||
|
|
|
@ -23,8 +23,13 @@
|
||||||
#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>
|
||||||
|
#if __cpp_lib_source_location == 201907L
|
||||||
|
#include <source_location>
|
||||||
|
using std::source_location;
|
||||||
|
#else
|
||||||
#include <experimental/source_location>
|
#include <experimental/source_location>
|
||||||
|
# ifdef __cpp_lib_experimental_source_location
|
||||||
using std::experimental::source_location;
|
using std::experimental::source_location;
|
||||||
# else
|
# else
|
||||||
struct source_location { // dummy placeholder
|
struct source_location { // dummy placeholder
|
||||||
|
@ -35,6 +40,7 @@ struct source_location { // dummy placeholder
|
||||||
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
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue