mirror of https://github.com/YosysHQ/yosys.git
Make C++17 compiler required
This commit is contained in:
parent
74a1dd99ac
commit
141a2e3638
|
@ -64,11 +64,11 @@ jobs:
|
||||||
$CXX --version
|
$CXX --version
|
||||||
|
|
||||||
# minimum standard
|
# minimum standard
|
||||||
- name: Build C++11
|
- name: Build C++17
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
make config-$CC_SHORT
|
make config-$CC_SHORT
|
||||||
make -j$procs CXXSTD=c++11 compile-only
|
make -j$procs CXXSTD=c++17 compile-only
|
||||||
|
|
||||||
# maximum standard, only on newest compilers
|
# maximum standard, only on newest compilers
|
||||||
- name: Build C++20
|
- name: Build C++20
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -90,7 +90,7 @@ all: top-all
|
||||||
YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
|
YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
|
||||||
VPATH := $(YOSYS_SRC)
|
VPATH := $(YOSYS_SRC)
|
||||||
|
|
||||||
CXXSTD ?= c++11
|
CXXSTD ?= c++17
|
||||||
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
|
CXXFLAGS := $(CXXFLAGS) -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -MP -D_YOSYS_ -fPIC -I$(PREFIX)/include
|
||||||
LIBS := $(LIBS) -lstdc++ -lm
|
LIBS := $(LIBS) -lstdc++ -lm
|
||||||
PLUGIN_LINKFLAGS :=
|
PLUGIN_LINKFLAGS :=
|
||||||
|
@ -1015,7 +1015,7 @@ qtcreator:
|
||||||
vcxsrc: $(GENFILES) $(EXTRA_TARGETS)
|
vcxsrc: $(GENFILES) $(EXTRA_TARGETS)
|
||||||
rm -rf yosys-win32-vcxsrc-$(YOSYS_VER){,.zip}
|
rm -rf yosys-win32-vcxsrc-$(YOSYS_VER){,.zip}
|
||||||
set -e; for f in `ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
|
set -e; for f in `ls $(filter %.cc %.cpp,$(GENFILES)) $(addsuffix .cc,$(basename $(OBJS))) $(addsuffix .cpp,$(basename $(OBJS))) 2> /dev/null`; do \
|
||||||
echo "Analyse: $$f" >&2; cpp -std=c++11 -MM -I. -D_YOSYS_ $$f; done | sed 's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep '^[^/]' | sort -u | grep -v kernel/version_ > srcfiles.txt
|
echo "Analyse: $$f" >&2; cpp -std=c++17 -MM -I. -D_YOSYS_ $$f; done | sed 's,.*:,,; s,//*,/,g; s,/[^/]*/\.\./,/,g; y, \\,\n\n,;' | grep '^[^/]' | sort -u | grep -v kernel/version_ > srcfiles.txt
|
||||||
bash misc/create_vcxsrc.sh yosys-win32-vcxsrc $(YOSYS_VER) $(GIT_REV)
|
bash misc/create_vcxsrc.sh yosys-win32-vcxsrc $(YOSYS_VER) $(GIT_REV)
|
||||||
echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel/version.cc
|
echo "namespace Yosys { extern const char *yosys_version_str; const char *yosys_version_str=\"Yosys (Version Information Unavailable)\"; }" > kernel/version.cc
|
||||||
zip yosys-win32-vcxsrc-$(YOSYS_VER)/genfiles.zip $(GENFILES) kernel/version.cc
|
zip yosys-win32-vcxsrc-$(YOSYS_VER)/genfiles.zip $(GENFILES) kernel/version.cc
|
||||||
|
|
|
@ -142,12 +142,8 @@ extern Tcl_Obj *Tcl_ObjSetVar2(Tcl_Interp *interp, Tcl_Obj *part1Ptr, Tcl_Obj *p
|
||||||
|
|
||||||
#if __cplusplus >= 201703L
|
#if __cplusplus >= 201703L
|
||||||
# define YS_FALLTHROUGH [[fallthrough]];
|
# define YS_FALLTHROUGH [[fallthrough]];
|
||||||
#elif defined(__clang__)
|
|
||||||
# define YS_FALLTHROUGH [[clang::fallthrough]];
|
|
||||||
#elif defined(__GNUC__)
|
|
||||||
# define YS_FALLTHROUGH [[gnu::fallthrough]];
|
|
||||||
#else
|
#else
|
||||||
# define YS_FALLTHROUGH
|
# error "C++17 or later compatible compiler is required"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue