mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
scripts: waifulib: compiler_optimizations: fixes for LTO
This commit is contained in:
@@ -99,13 +99,13 @@ CFLAGS = {
|
||||
|
||||
LTO_CFLAGS = {
|
||||
'msvc': ['/GL'],
|
||||
'gcc': ['-flto'],
|
||||
'gcc': ['-flto=auto'],
|
||||
'clang': ['-flto']
|
||||
}
|
||||
|
||||
LTO_LINKFLAGS = {
|
||||
'msvc': ['/LTCG'],
|
||||
'gcc': ['-flto'],
|
||||
'gcc': ['-flto=auto'],
|
||||
'clang': ['-flto']
|
||||
}
|
||||
|
||||
@@ -177,4 +177,8 @@ def get_optimization_flags(conf):
|
||||
# remove fvisibility to allow everything to be exported by default
|
||||
cflags.remove('-fvisibility=hidden')
|
||||
|
||||
# on all compilers (except MSVC?) we need to copy CFLAGS to LINKFLAGS
|
||||
if conf.options.LTO and conf.env.COMPILER_CC != 'msvc':
|
||||
linkflags += cflags
|
||||
|
||||
return cflags, linkflags
|
||||
|
||||
Reference in New Issue
Block a user