From 5fe431b8da48da9a82600d913b213d3eb005dc5c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 16 May 2024 10:47:35 +1000 Subject: [PATCH] init: use emit CMAKE_TOOLCHAIN_FILE rather than compile names --- init.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/init.py b/init.py index 29df433..484d81a 100755 --- a/init.py +++ b/init.py @@ -48,16 +48,16 @@ def merge_option(a: Option, b: Option) -> Option: ############################################################################### OPTIONS['gcc'] = Option( vars={ - 'CMAKE_CXX_COMPILER': 'g++', - 'CMAKE_C_COMPILER': 'gcc' + #'CMAKE_CXX_COMPILER': 'g++', + #'CMAKE_C_COMPILER': 'gcc' }, compiler='gcc', ) OPTIONS['clang'] = Option( vars={ - 'CMAKE_CXX_COMPILER': f'clang++', - 'CMAKE_C_COMPILER': f'clang', + #'CMAKE_CXX_COMPILER': f'clang++', + #'CMAKE_C_COMPILER': f'clang', #'CMAKE_CXX_FLAGS': '-fuse-ld=lld', }, compiler='clang', @@ -143,10 +143,10 @@ OPTIONS['ninja'] = Option( # ----------------------------------------------------------------------------- OPTIONS['mingw'] = Option( vars={ - 'CMAKE_TOOLCHAIN_FILE': os.path.join( - os.path.dirname(__file__), - 'cmake', 'toolchain', 'mingw' - ) + # 'CMAKE_TOOLCHAIN_FILE': os.path.join( + # os.path.dirname(__file__), + # 'cmake', 'toolchain', 'mingw' + # ) }, compiler='gcc', platform='mingw', @@ -156,10 +156,10 @@ OPTIONS['mingw'] = Option( # ----------------------------------------------------------------------------- OPTIONS['pi3'] = Option( vars={ - 'CMAKE_TOOLCHAIN_FILE': os.path.join( - os.path.dirname(__file__), - 'cmake', 'toolchain', 'armv7a-gcc' - ) + # 'CMAKE_TOOLCHAIN_FILE': os.path.join( + # os.path.dirname(__file__), + # 'cmake', 'toolchain', 'armv7a-gcc' + # ) }, arch="armv7", compiler='gcc', @@ -227,6 +227,7 @@ if __name__ == '__main__': accum = merge_option(accum, OPTIONS[i]) 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([ 'x86_64',