Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Sep 9, 2023
1 parent d3222eb commit 21e54a2
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,31 @@ if (WIN32)
set(Boost_USE_STATIC_RUNTIME ON)
endif()

project(apngasm-python VERSION 1.0.6)
set(PY_VERSION_SUFFIX "")
set(PY_FULL_VERSION ${PROJECT_VERSION}${PY_VERSION_SUFFIX})

# Make sure that the Python and CMake versions match
if (DEFINED PY_BUILD_CMAKE_PACKAGE_VERSION)
if (NOT "${PY_BUILD_CMAKE_PACKAGE_VERSION}" MATCHES "^${PY_FULL_VERSION}$")
message(FATAL_ERROR "Version number does not match "
"(${PY_BUILD_CMAKE_PACKAGE_VERSION} - ${PY_FULL_VERSION}).")
endif()
endif()

# Find the nanobind package
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})
Expand All @@ -65,23 +82,6 @@ else()
endif()
endif()


project(apngasm-python VERSION 1.0.6)
set(PY_VERSION_SUFFIX "")
set(PY_FULL_VERSION ${PROJECT_VERSION}${PY_VERSION_SUFFIX})

# Make sure that the Python and CMake versions match
if (DEFINED PY_BUILD_CMAKE_PACKAGE_VERSION)
if (NOT "${PY_BUILD_CMAKE_PACKAGE_VERSION}" MATCHES "^${PY_FULL_VERSION}$")
message(FATAL_ERROR "Version number does not match "
"(${PY_BUILD_CMAKE_PACKAGE_VERSION} - ${PY_FULL_VERSION}).")
endif()
endif()

# Find the nanobind package
include(cmake/QueryPythonForNanobind.cmake)
find_nanobind_python_first()

# Compile the Python module
nanobind_add_module(_apngasm_python "src/apngasm_python.cpp" NB_STATIC STABLE_ABI)
if (WIN32)
Expand Down

0 comments on commit 21e54a2

Please sign in to comment.