diff --git a/SConstruct b/SConstruct index fbbd0ea31938..af5063ebdc52 100755 --- a/SConstruct +++ b/SConstruct @@ -525,7 +525,7 @@ for env in [test_env, client_env, env]: rel_comp_flags = rel_comp_flags + env["arch"] # PGO and LTO setup - if "gcc" in env["TOOLS"]: + if "gcc" in env["CXX"]: if env["pgo_data"] == "generate": rel_comp_flags = rel_comp_flags + " -fprofile-generate=pgo_data/" rel_link_flags = "-fprofile-generate=pgo_data/" @@ -537,6 +537,9 @@ 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" + ''' Disabled because LTO+Clang causes builds to fail on some systems + and LTO is enabled by default - without this, building with Clang would be impossible + for some users. elif "clang" in env["CXX"]: if env["pgo_data"] == "generate": rel_comp_flags = rel_comp_flags + " -fprofile-instr-generate=pgo_data/wesnoth-%p.profraw" @@ -549,6 +552,7 @@ for env in [test_env, client_env, env]: if env["enable_lto"] == True: rel_comp_flags = rel_comp_flags + " -flto=thin" rel_link_flags = rel_comp_flags + " -fuse-ld=lld" + ''' # # # End setting options for release build