Skip to content

Commit

Permalink
update CMakeLists.txt to avoid explicit dynamic linking with system's…
Browse files Browse the repository at this point in the history
… libpythonX.Y.so
  • Loading branch information
ArchieMeng committed Apr 18, 2021
1 parent 6530bb0 commit 22a8413
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
cmake_minimum_required(VERSION 3.15)
cmake_policy(SET CMP0091 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

project(srmd-ncnn-vulkan-python)

# SWIG
find_package(PythonLibs REQUIRED)
find_package(Python REQUIRED COMPONENTS Development)
find_package(SWIG REQUIRED COMPONENTS python)
if(SWIG_FOUND)
message("SWIG found: ${SWIG_EXECUTABLE}")
Expand All @@ -14,9 +15,6 @@ if(SWIG_FOUND)
message(WARNING "SWIG python bindings cannot be generated")
endif()
endif()
include_directories(${PYTHON_INCLUDE_DIRS})

cmake_minimum_required(VERSION 3.9)

option(USE_SYSTEM_NCNN "build with system libncnn" OFF)
option(USE_SYSTEM_WEBP "build with system libwebp" OFF)
Expand Down Expand Up @@ -275,4 +273,4 @@ include_directories(.)
swig_add_library(srmd_ncnn_vulkan_wrapper LANGUAGE python SOURCES srmd.i srmd.cpp srmd_wrapper.cpp)
add_dependencies(srmd_ncnn_vulkan_wrapper generate-spirv)
target_compile_options(srmd_ncnn_vulkan_wrapper PUBLIC -fexceptions)
target_link_libraries(srmd_ncnn_vulkan_wrapper ${SRMD_LINK_LIBRARIES} ${PYTHON_LIBRARIES})
target_link_libraries(srmd_ncnn_vulkan_wrapper ${SRMD_LINK_LIBRARIES} Python::Module)

0 comments on commit 22a8413

Please sign in to comment.