From ac4f7b5816ac59f882cdf48c3a7b9403360e7f94 Mon Sep 17 00:00:00 2001 From: laggykiller Date: Sun, 10 Sep 2023 02:18:33 +0800 Subject: [PATCH] Test not using toolchain --- CMakeLists.txt | 36 +++++------------------------------- get_deps.py | 43 +++++++++++-------------------------------- 2 files changed, 16 insertions(+), 63 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1538a3c..4dd21d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,37 +43,11 @@ if (WIN32) endif() # Add conan packages -if ("${APNGASM_COMPILE_TARGET}" STREQUAL "universal2") - set(CONAN_ROOT_X64 ${CMAKE_SOURCE_DIR}/conan_output/x86_64/direct_deploy) - set(CONAN_ROOT_ARM ${CMAKE_SOURCE_DIR}/conan_output/armv8/direct_deploy) - - list(PREPEND CMAKE_PREFIX_PATH - ${CONAN_ROOT_X64} - ${CONAN_ROOT_ARM}) - - list(PREPEND CMAKE_LIBRARY_PATH - ${CONAN_ROOT_X64}/libpng/lib - ${CONAN_ROOT_ARM}/libpng/lib - ${CONAN_ROOT_X64}/boost/lib - ${CONAN_ROOT_ARM}/boost/lib - ${CONAN_ROOT_X64}/zlib/lib - ${CONAN_ROOT_ARM}/zlib/lib) - - list(PREPEND CMAKE_INCLUDE_PATH - ${CONAN_ROOT_X64}/libpng/include - ${CONAN_ROOT_ARM}/libpng/include - ${CONAN_ROOT_X64}/boost/include - ${CONAN_ROOT_ARM}/boost/include - ${CONAN_ROOT_X64}/zlib/include - ${CONAN_ROOT_ARM}/zlib/include) -else() - set(CONAN_TOOLCHAIN ${CMAKE_SOURCE_DIR}/conan_output/${APNGASM_COMPILE_TARGET}/conan_toolchain.cmake) - if (EXISTS ${CONAN_TOOLCHAIN}) - include(${CONAN_TOOLCHAIN}) - else() - message(WARNING "The conan_toolchain file could not be found: ${CONAN_TOOLCHAIN}") - endif() -endif() +set(CONAN_ROOT ${CMAKE_SOURCE_DIR}/conan_output/${APNGASM_COMPILE_TARGET}/direct_deploy) + +set(ZLIB_ROOT ${CONAN_ROOT}/zlib) +set(PNG_ROOT ${CONAN_ROOT}/libpng) +set(Boost_ROOT ${CONAN_ROOT}/boost) project(apngasm-python VERSION 1.0.6) set(PY_VERSION_SUFFIX "") diff --git a/get_deps.py b/get_deps.py index a7ade05..1770bc8 100755 --- a/get_deps.py +++ b/get_deps.py @@ -59,44 +59,23 @@ def install_deps(arch): def main(): arch = get_arch() - if arch != 'universal2': - conan_output = os.path.join('conan_output', arch) - if os.path.isdir(conan_output): - print('Dependencies found at:' + conan_output) - print('Skip conan install...') - return - else: - conan_output_1 = 'conan_output/x86_64' - conan_output_2 = 'conan_output/armv8' - if os.path.isdir(conan_output_1) and os.path.isdir(conan_output_2): - print('Dependencies (x86_64) found at:' + conan_output_1) - print('Dependencies (armv8) found at:' + conan_output_2) - print('Skip conan install...') - return + conan_output = 'conan_output/' + arch + '/direct_deploy' + if os.path.isdir(conan_output): + print('Dependencies found at:' + conan_output) + print('Skip conan install...') + return conan_output = install_deps(arch) if os.getenv('APNGASM_COMPILE_TARGET') == 'universal2': # Repeat to install the other architecture version of libwebp conan_output_x64 = install_deps('x86_64') - # conan_output_universal2 = conan_output.replace('armv8', 'universal2') - # shutil.rmtree(conan_output_universal2, ignore_errors=True) - # subprocess.run([ - # 'python3', 'lipo-dir-merge/lipo-dir-merge.py', - # conan_output_x64, conan_output, conan_output_universal2 - # ]) - - # with open(os.path.join(conan_output_universal2, 'CMakePresets.json')) as f: - # cmake_presets = f.read() - # cmake_presets = cmake_presets.replace('x86_64', 'universal2') - # with open(os.path.join(conan_output_universal2, 'CMakePresets.json'), 'w+') as f: - # f.write(cmake_presets) - - # with open(os.path.join(conan_output_universal2, 'conan_toolchain.cmake')) as f: - # conan_toolchain = f.read() - # conan_toolchain = conan_toolchain.replace('x86_64', 'universal2') - # with open(os.path.join(conan_output_universal2, 'conan_toolchain.cmake'), 'w+') as f: - # f.write(conan_toolchain) + conan_output_universal2 = conan_output.replace('armv8', 'universal2') + shutil.rmtree(conan_output_universal2, ignore_errors=True) + subprocess.run([ + 'python3', 'lipo-dir-merge/lipo-dir-merge.py', + conan_output_x64, conan_output, conan_output_universal2 + ]) if __name__ == '__main__': main() \ No newline at end of file