Skip to content

Commit

Permalink
fix MSVC build
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz committed Jun 13, 2022
1 parent 9e572c7 commit 3d153f8
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions csrc/mmdeploy/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ if (MMDEPLOY_SPDLOG_EXTERNAL)
else ()
set(MMDEPLOY_SPDLOG_DIR ${CMAKE_SOURCE_DIR}/third_party/spdlog)
add_subdirectory(${MMDEPLOY_SPDLOG_DIR} ${CMAKE_CURRENT_BINARY_DIR}/spdlog EXCLUDE_FROM_ALL)
target_include_directories(spdlog INTERFACE
$<INSTALL_INTERFACE:include/mmdeploy/third_party>)
set_target_properties(spdlog PROPERTIES POSITION_INDEPENDENT_CODE ON)
set(SPDLOG_LIB spdlog::spdlog)
mmdeploy_export(spdlog)
Expand Down Expand Up @@ -48,20 +46,19 @@ target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/csrc>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/outcome>
$<INSTALL_INTERFACE:include/mmdeploy/third_party/outcome>
# TODO: remove dependency of `json`
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/third_party/json>
$<INSTALL_INTERFACE:include/mmdeploy/third_party/json>
)

if (NOT MMDEPLOY_SPDLOG_EXTERNAL)
target_include_directories(${PROJECT_NAME}
PUBLIC)
endif ()

if (MMDEPLOY_BUILD_SDK_CXX_API)
target_include_directories(${PROJECT_NAME} PUBLIC
$<INSTALL_INTERFACE:include>)
$<INSTALL_INTERFACE:include>
$<INSTALL_INTERFACE:include/mmdeploy/third_party/outcome>
$<INSTALL_INTERFACE:include/mmdeploy/third_party/json>)
if (NOT MMDEPLOY_SPDLOG_EXTERNAL)
target_include_directories(spdlog INTERFACE
$<INSTALL_INTERFACE:include/mmdeploy/third_party>)
endif ()
endif ()

target_link_libraries(${PROJECT_NAME} PUBLIC ${SPDLOG_LIB})
Expand Down

0 comments on commit 3d153f8

Please sign in to comment.