MNN/express/CMakeLists.txt

22 lines
767 B
CMake

file(GLOB_RECURSE MNN_EXPR_SRCS "${CMAKE_CURRENT_LIST_DIR}/*.*")
option(MNN_EXPR_ENABLE_PROFILER "Support profile Expr's op cost" OFF)
option(MNN_EXPR_SHAPE_EAGER "Force compute Expr's shape directly cost" OFF)
IF (MNN_EXPR_ENABLE_PROFILER)
add_definitions(-DMNN_EXPR_ENABLE_PROFILER)
ENDIF()
IF (MNN_EXPR_SHAPE_EAGER)
add_definitions(-DMNN_EXPR_SHAPE_EAGER)
ENDIF()
IF(MNN_SEP_BUILD)
if (MNN_BUILD_FOR_ANDROID_COMMAND)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "../")
endif()
add_library(MNN_Express SHARED ${MNN_EXPR_SRCS})
target_link_libraries(MNN_Express MNN)
if (MNN_BUILD_MINI)
target_link_libraries(MNN_Express $<TARGET_OBJECTS:MNNTransform>)
endif()
ELSE()
add_library(MNNExpress OBJECT ${MNN_EXPR_SRCS})
ENDIF()