From 87e0158afd92576b0ae0e45a3472cfe7df658265 Mon Sep 17 00:00:00 2001 From: laggykiller Date: Sun, 10 Sep 2023 01:47:20 +0800 Subject: [PATCH] Fix build --- CMakeLists.txt | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 017647f..eb6e5ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,30 @@ execute_process( ) message(STATUS "Finished get_deps.py") +# Add conan packages +if ("${APNGASM_COMPILE_TARGET}" STREQUAL "universal2") + set(CONAN_TOOLCHAIN_1 ${CMAKE_SOURCE_DIR}/conan_output/armv8/conan_toolchain.cmake) + if (EXISTS ${CONAN_TOOLCHAIN_1}) + include(${CONAN_TOOLCHAIN_1}) + else() + message(WARNING "The conan_toolchain file could not be found: ${CONAN_TOOLCHAIN_1}") + endif() + + set(CONAN_TOOLCHAIN_2 ${CMAKE_SOURCE_DIR}/conan_output/x86_64/conan_toolchain.cmake) + if (EXISTS ${CONAN_TOOLCHAIN_2}) + include(${CONAN_TOOLCHAIN_2}) + else() + message(WARNING "The conan_toolchain file could not be found: ${CONAN_TOOLCHAIN_2}") + endif() +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() + if (WIN32) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") @@ -58,30 +82,6 @@ endif() include(cmake/QueryPythonForNanobind.cmake) find_nanobind_python_first() -# Add conan packages -if ("${APNGASM_COMPILE_TARGET}" STREQUAL "universal2") - set(CONAN_TOOLCHAIN_1 ${CMAKE_SOURCE_DIR}/conan_output/x86_64/conan_toolchain.cmake) - if (EXISTS ${CONAN_TOOLCHAIN_1}) - include(${CONAN_TOOLCHAIN_1}) - else() - message(WARNING "The conan_toolchain file could not be found: ${CONAN_TOOLCHAIN_1}") - endif() - - set(CONAN_TOOLCHAIN_2 ${CMAKE_SOURCE_DIR}/conan_output/armv8/conan_toolchain.cmake) - if (EXISTS ${CONAN_TOOLCHAIN_2}) - include(${CONAN_TOOLCHAIN_2}) - else() - message(WARNING "The conan_toolchain file could not be found: ${CONAN_TOOLCHAIN_1}") - endif() -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() - # Compile the Python module nanobind_add_module(_apngasm_python "src/apngasm_python.cpp" NB_STATIC STABLE_ABI) if (WIN32)