Skip to content

Commit

Permalink
Hide warnings from GCC if compiling with LTO
Browse files Browse the repository at this point in the history
This adds the change from d543edc (in scons) and 941433e (in cmake) to the linking step as well, but only when using LTO

closes  #5350
  • Loading branch information
sevu committed Jan 17, 2021
1 parent deeb746 commit bc99e69
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -382,7 +382,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto=${LTO_JOBS}" CACHE STRING "Release build flags with LTO" FORCE)

MESSAGE("Using GCC gold linker")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fuse-ld=gold" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fuse-ld=gold -Wno-stringop-overflow" CACHE STRING "" FORCE)
endif(ENABLE_LTO)
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

Expand Down
2 changes: 1 addition & 1 deletion SConstruct
Expand Up @@ -591,7 +591,7 @@ for env in [test_env, client_env, env]:

if env["enable_lto"] == True:
rel_comp_flags = rel_comp_flags + " -flto=" + str(env["jobs"])
rel_link_flags = rel_comp_flags + " -fuse-ld=gold"
rel_link_flags = rel_comp_flags + " -fuse-ld=gold -Wno-stringop-overflow"
elif "clang" in env["CXX"]:
if env["pgo_data"] == "generate":
rel_comp_flags = rel_comp_flags + " -fprofile-instr-generate=pgo_data/wesnoth-%p.profraw"
Expand Down

0 comments on commit bc99e69

Please sign in to comment.