mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 02:25:53 +00:00
Use gnu gold or clang lld linkers if available
This commit is contained in:
@@ -509,6 +509,15 @@ macro(setup_build_boilerplate)
|
|||||||
|
|
||||||
if (is_gcc)
|
if (is_gcc)
|
||||||
add_compile_options(-Wno-unused-but-set-variable -Wno-deprecated)
|
add_compile_options(-Wno-unused-but-set-variable -Wno-deprecated)
|
||||||
|
|
||||||
|
# use gold linker if available
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=gold -Wl,--version
|
||||||
|
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
|
if ("${LD_VERSION}" MATCHES "GNU gold")
|
||||||
|
append_flags(CMAKE_EXE_LINKER_FLAGS -fuse-ld=gold)
|
||||||
|
endif ()
|
||||||
|
unset(LD_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Generator expressions are not supported in add_definitions, use set_property instead
|
# Generator expressions are not supported in add_definitions, use set_property instead
|
||||||
@@ -551,6 +560,15 @@ macro(setup_build_boilerplate)
|
|||||||
add_compile_options(
|
add_compile_options(
|
||||||
-Wno-redeclared-class-member -Wno-mismatched-tags -Wno-deprecated-register)
|
-Wno-redeclared-class-member -Wno-mismatched-tags -Wno-deprecated-register)
|
||||||
add_definitions(-DBOOST_ASIO_HAS_STD_ARRAY)
|
add_definitions(-DBOOST_ASIO_HAS_STD_ARRAY)
|
||||||
|
|
||||||
|
# use ldd linker if available
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=lld -Wl,--version
|
||||||
|
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
|
||||||
|
if ("${LD_VERSION}" MATCHES "LLD")
|
||||||
|
append_flags(CMAKE_EXE_LINKER_FLAGS -fuse-ld=lld)
|
||||||
|
endif ()
|
||||||
|
unset(LD_VERSION)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|||||||
15
SConstruct
15
SConstruct
@@ -552,6 +552,13 @@ def config_env(toolchain, variant, env):
|
|||||||
if toolchain == 'clang':
|
if toolchain == 'clang':
|
||||||
env.Append(CCFLAGS=['-Wno-redeclared-class-member'])
|
env.Append(CCFLAGS=['-Wno-redeclared-class-member'])
|
||||||
env.Append(CPPDEFINES=['BOOST_ASIO_HAS_STD_ARRAY'])
|
env.Append(CPPDEFINES=['BOOST_ASIO_HAS_STD_ARRAY'])
|
||||||
|
try:
|
||||||
|
ldd_ver = subprocess.check_output([env['CLANG_CXX'], '-fuse-ld=lld', '-Wl,--version'],
|
||||||
|
stderr=subprocess.STDOUT).strip()
|
||||||
|
# have lld
|
||||||
|
env.Append(LINKFLAGS=['-fuse-ld=lld'])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
env.Append(CXXFLAGS=[
|
env.Append(CXXFLAGS=[
|
||||||
'-frtti',
|
'-frtti',
|
||||||
@@ -583,11 +590,17 @@ def config_env(toolchain, variant, env):
|
|||||||
'-D_GLIBCXX_USE_CXX11_ABI' : 0
|
'-D_GLIBCXX_USE_CXX11_ABI' : 0
|
||||||
})
|
})
|
||||||
if toolchain == 'gcc':
|
if toolchain == 'gcc':
|
||||||
|
|
||||||
env.Append(CCFLAGS=[
|
env.Append(CCFLAGS=[
|
||||||
'-Wno-unused-but-set-variable',
|
'-Wno-unused-but-set-variable',
|
||||||
'-Wno-deprecated',
|
'-Wno-deprecated',
|
||||||
])
|
])
|
||||||
|
try:
|
||||||
|
ldd_ver = subprocess.check_output([env['GNU_CXX'], '-fuse-ld=gold', '-Wl,--version'],
|
||||||
|
stderr=subprocess.STDOUT).strip()
|
||||||
|
# have ld.gold
|
||||||
|
env.Append(LINKFLAGS=['-fuse-ld=gold'])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
boost_libs = [
|
boost_libs = [
|
||||||
# resist the temptation to alphabetize these. coroutine
|
# resist the temptation to alphabetize these. coroutine
|
||||||
|
|||||||
@@ -498,9 +498,6 @@ isDirectXrpToXrp<XRPAmount, XRPAmount> (Strand const& strand)
|
|||||||
return (strand.size () == 2);
|
return (strand.size () == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template
|
|
||||||
bool
|
|
||||||
isDirectXrpToXrp<XRPAmount, XRPAmount> (Strand const& strand);
|
|
||||||
template
|
template
|
||||||
bool
|
bool
|
||||||
isDirectXrpToXrp<XRPAmount, IOUAmount> (Strand const& strand);
|
isDirectXrpToXrp<XRPAmount, IOUAmount> (Strand const& strand);
|
||||||
|
|||||||
Reference in New Issue
Block a user