You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Add "llvm/thinlto" options to MinGW build.
This commit is contained in:
@@ -65,6 +65,8 @@ def get_opts():
|
|||||||
BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False),
|
BoolVariable('separate_debug_symbols', 'Create a separate file containing debugging symbols', False),
|
||||||
('msvc_version', 'MSVC version to use. Ignored if VCINSTALLDIR is set in shell env.', None),
|
('msvc_version', 'MSVC version to use. Ignored if VCINSTALLDIR is set in shell env.', None),
|
||||||
BoolVariable('use_mingw', 'Use the Mingw compiler, even if MSVC is installed. Only used on Windows.', False),
|
BoolVariable('use_mingw', 'Use the Mingw compiler, even if MSVC is installed. Only used on Windows.', False),
|
||||||
|
BoolVariable('use_llvm', 'Use the LLVM compiler', False),
|
||||||
|
BoolVariable('use_thinlto', 'Use ThinLTO', False),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -312,6 +314,14 @@ def configure_mingw(env):
|
|||||||
env.Append(LINKFLAGS=['-static'])
|
env.Append(LINKFLAGS=['-static'])
|
||||||
mingw_prefix = env["mingw_prefix_64"]
|
mingw_prefix = env["mingw_prefix_64"]
|
||||||
|
|
||||||
|
if env['use_llvm']:
|
||||||
|
env["CC"] = mingw_prefix + "clang"
|
||||||
|
env['AS'] = mingw_prefix + "as"
|
||||||
|
env["CXX"] = mingw_prefix + "clang++"
|
||||||
|
env['AR'] = mingw_prefix + "ar"
|
||||||
|
env['RANLIB'] = mingw_prefix + "ranlib"
|
||||||
|
env["LINK"] = mingw_prefix + "clang++"
|
||||||
|
else:
|
||||||
env["CC"] = mingw_prefix + "gcc"
|
env["CC"] = mingw_prefix + "gcc"
|
||||||
env['AS'] = mingw_prefix + "as"
|
env['AS'] = mingw_prefix + "as"
|
||||||
env['CXX'] = mingw_prefix + "g++"
|
env['CXX'] = mingw_prefix + "g++"
|
||||||
@@ -321,8 +331,16 @@ def configure_mingw(env):
|
|||||||
env["x86_libtheora_opt_gcc"] = True
|
env["x86_libtheora_opt_gcc"] = True
|
||||||
|
|
||||||
if env['use_lto']:
|
if env['use_lto']:
|
||||||
|
if not env['use_llvm'] and env.GetOption("num_jobs") > 1:
|
||||||
env.Append(CCFLAGS=['-flto'])
|
env.Append(CCFLAGS=['-flto'])
|
||||||
env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))])
|
env.Append(LINKFLAGS=['-flto=' + str(env.GetOption("num_jobs"))])
|
||||||
|
else:
|
||||||
|
if env['use_thinlto']:
|
||||||
|
env.Append(CCFLAGS=['-flto=thin'])
|
||||||
|
env.Append(LINKFLAGS=['-flto=thin'])
|
||||||
|
else:
|
||||||
|
env.Append(CCFLAGS=['-flto'])
|
||||||
|
env.Append(LINKFLAGS=['-flto'])
|
||||||
|
|
||||||
|
|
||||||
## Compile flags
|
## Compile flags
|
||||||
|
|||||||
Reference in New Issue
Block a user