mirror of
https://github.com/ziglang/zig.git
synced 2025-01-19 00:11:37 +00:00
fix compile error on gcc 7.3.0
Only set -Werror for debug builds, and only for zig itself, not for embedded LLD. See #1474
This commit is contained in:
parent
ac3cf0775f
commit
9a123697e3
@ -196,7 +196,7 @@ else()
|
||||
if(MSVC)
|
||||
set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -D_CRT_SECURE_NO_WARNINGS /w")
|
||||
else()
|
||||
set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -fno-exceptions -fno-rtti -Wno-comment -Wno-class-memaccess -Wno-unknown-warning-option")
|
||||
set(ZIG_LLD_COMPILE_FLAGS "-std=c++11 -fno-exceptions -fno-rtti -Wno-comment")
|
||||
endif()
|
||||
set_target_properties(embedded_lld_lib PROPERTIES
|
||||
COMPILE_FLAGS ${ZIG_LLD_COMPILE_FLAGS}
|
||||
@ -772,20 +772,23 @@ include_directories(
|
||||
"${CMAKE_SOURCE_DIR}/src"
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /w")
|
||||
elseif(MINGW)
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Werror -Wno-error=format= -Wno-error=format -Wno-error=format-extra-args")
|
||||
else()
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror -Wall -Wno-unknown-warning-option -Wno-error=class-memaccess")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
set(EXE_CFLAGS "-std=c++11")
|
||||
else()
|
||||
set(EXE_CFLAGS "-std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE -fno-exceptions -fno-rtti -Werror=strict-prototypes -Werror=old-style-definition -Werror=type-limits -Wno-missing-braces")
|
||||
endif()
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
if(MSVC)
|
||||
set(EXE_CFLAGS "${EXE_CFLAGS} /w")
|
||||
elseif(MINGW)
|
||||
set(EXE_CFLAGS "${EXE_CFLAGS} -Wall -Werror -Wno-error=format= -Wno-error=format -Wno-error=format-extra-args")
|
||||
else()
|
||||
set(EXE_CFLAGS "${EXE_CFLAGS} -Werror -Wall")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
set(EXE_LDFLAGS " ")
|
||||
if(MINGW)
|
||||
set(EXE_LDFLAGS "-static -static-libgcc -static-libstdc++")
|
||||
|
Loading…
Reference in New Issue
Block a user