Skip to content

Commit

Permalink
Test not using toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Sep 9, 2023
1 parent 1601099 commit ac4f7b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 63 deletions.
36 changes: 5 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand Down
43 changes: 11 additions & 32 deletions get_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit ac4f7b5

Please sign in to comment.