Only set flifetime-dse flag for GCC and not Clang

This commit is contained in:
Sam V 2023-02-02 15:19:15 +01:00
parent ba8089e1f3
commit ea1cdde3bf

View file

@ -39,10 +39,14 @@ else
ARCH_CFLAGS+=-gdwarf-2 -g2
endif
BASE_CFLAGS=-std=c++17 -fpermissive -fno-strict-aliasing -fno-exceptions -fexpensive-optimizations -Werror=return-type -w
BASE_CFLAGS+=-DNDEBUG -DPOSIX -D_POSIX -DLINUX -D_LINUX -DGNUC -DNO_MALLOC_OVERRIDE -DCLIENT_WEAPONS
# flifetime-dse=1 is needed to disable a compiler optimization that optimizes out std::memset calls in CBaseEntity::operator new
# See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-flifetime-dse for more information about the flifetime-dse flag
BASE_CFLAGS=-std=c++17 -fpermissive -fno-strict-aliasing -fno-exceptions -fexpensive-optimizations -Werror=return-type -w -flifetime-dse=1
BASE_CFLAGS+=-DNDEBUG -DPOSIX -D_POSIX -DLINUX -D_LINUX -DGNUC -DNO_MALLOC_OVERRIDE -DCLIENT_WEAPONS
ifeq "$(COMPILER)" "g++"
BASE_CFLAGS+=-flifetime-dse=1
endif
SHLIBEXT=so
SHLIBCFLAGS=