init: use emit CMAKE_TOOLCHAIN_FILE rather than compile names
This commit is contained in:
parent
1cf517309b
commit
5fe431b8da
25
init.py
25
init.py
@ -48,16 +48,16 @@ def merge_option(a: Option, b: Option) -> Option:
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
OPTIONS['gcc'] = Option(
|
OPTIONS['gcc'] = Option(
|
||||||
vars={
|
vars={
|
||||||
'CMAKE_CXX_COMPILER': 'g++',
|
#'CMAKE_CXX_COMPILER': 'g++',
|
||||||
'CMAKE_C_COMPILER': 'gcc'
|
#'CMAKE_C_COMPILER': 'gcc'
|
||||||
},
|
},
|
||||||
compiler='gcc',
|
compiler='gcc',
|
||||||
)
|
)
|
||||||
|
|
||||||
OPTIONS['clang'] = Option(
|
OPTIONS['clang'] = Option(
|
||||||
vars={
|
vars={
|
||||||
'CMAKE_CXX_COMPILER': f'clang++',
|
#'CMAKE_CXX_COMPILER': f'clang++',
|
||||||
'CMAKE_C_COMPILER': f'clang',
|
#'CMAKE_C_COMPILER': f'clang',
|
||||||
#'CMAKE_CXX_FLAGS': '-fuse-ld=lld',
|
#'CMAKE_CXX_FLAGS': '-fuse-ld=lld',
|
||||||
},
|
},
|
||||||
compiler='clang',
|
compiler='clang',
|
||||||
@ -143,10 +143,10 @@ OPTIONS['ninja'] = Option(
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
OPTIONS['mingw'] = Option(
|
OPTIONS['mingw'] = Option(
|
||||||
vars={
|
vars={
|
||||||
'CMAKE_TOOLCHAIN_FILE': os.path.join(
|
# 'CMAKE_TOOLCHAIN_FILE': os.path.join(
|
||||||
os.path.dirname(__file__),
|
# os.path.dirname(__file__),
|
||||||
'cmake', 'toolchain', 'mingw'
|
# 'cmake', 'toolchain', 'mingw'
|
||||||
)
|
# )
|
||||||
},
|
},
|
||||||
compiler='gcc',
|
compiler='gcc',
|
||||||
platform='mingw',
|
platform='mingw',
|
||||||
@ -156,10 +156,10 @@ OPTIONS['mingw'] = Option(
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
OPTIONS['pi3'] = Option(
|
OPTIONS['pi3'] = Option(
|
||||||
vars={
|
vars={
|
||||||
'CMAKE_TOOLCHAIN_FILE': os.path.join(
|
# 'CMAKE_TOOLCHAIN_FILE': os.path.join(
|
||||||
os.path.dirname(__file__),
|
# os.path.dirname(__file__),
|
||||||
'cmake', 'toolchain', 'armv7a-gcc'
|
# 'cmake', 'toolchain', 'armv7a-gcc'
|
||||||
)
|
# )
|
||||||
},
|
},
|
||||||
arch="armv7",
|
arch="armv7",
|
||||||
compiler='gcc',
|
compiler='gcc',
|
||||||
@ -227,6 +227,7 @@ if __name__ == '__main__':
|
|||||||
accum = merge_option(accum, OPTIONS[i])
|
accum = merge_option(accum, OPTIONS[i])
|
||||||
|
|
||||||
accumulated = [f'"-D{key}={val}"' for key, val in accum.vars.items()] + accum.args
|
accumulated = [f'"-D{key}={val}"' for key, val in accum.vars.items()] + accum.args
|
||||||
|
accumulated.append('-DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake')
|
||||||
|
|
||||||
conan_build_profile = '-'.join([
|
conan_build_profile = '-'.join([
|
||||||
'x86_64',
|
'x86_64',
|
||||||
|
Loading…
Reference in New Issue
Block a user