34 lines
947 B
CMake
34 lines
947 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
project(archery_netcore CXX)
|
|
|
|
set(CMAKE_SYSTEM_NAME Linux)
|
|
set(CMAKE_SYSTEM_PROCESSOR riscv64)
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
if(NOT DEFINED PY_INCLUDE_DIR)
|
|
message(FATAL_ERROR "PY_INCLUDE_DIR not set")
|
|
endif()
|
|
if(NOT DEFINED PY_LIB)
|
|
message(FATAL_ERROR "PY_LIB not set")
|
|
endif()
|
|
if(NOT DEFINED PY_EXT_SUFFIX)
|
|
message(FATAL_ERROR "PY_EXT_SUFFIX not set")
|
|
endif()
|
|
if(NOT DEFINED MAIXCDK_PATH)
|
|
message(FATAL_ERROR "MAIXCDK_PATH not set (need components/3rd_party/pybind11)")
|
|
endif()
|
|
|
|
add_library(archery_netcore MODULE archery_netcore.cpp)
|
|
|
|
target_include_directories(archery_netcore PRIVATE
|
|
"${PY_INCLUDE_DIR}"
|
|
"${MAIXCDK_PATH}/components/3rd_party/pybind11/pybind11/include"
|
|
)
|
|
|
|
set_target_properties(archery_netcore PROPERTIES
|
|
PREFIX ""
|
|
SUFFIX "${PY_EXT_SUFFIX}"
|
|
)
|
|
|
|
target_link_libraries(archery_netcore PRIVATE "${PY_LIB}") |