mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-29 18:52:30 +00:00 
			
		
		
		
	source_location: Auto detect library
Drop `ENABLE_SOURCE_LOCATION` flag.
This commit is contained in:
		
							parent
							
								
									4722b07485
								
							
						
					
					
						commit
						534163cf4b
					
				
					 2 changed files with 9 additions and 7 deletions
				
			
		
							
								
								
									
										4
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
										
									
									
									
								
							|  | @ -532,10 +532,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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue