cmake: Fix python linker issues on windows.
Recent cmake work made the debug build link both python37.dll and python37_d.dll
This commit is contained in:
parent
1a4b60c30d
commit
b46245470f
Notes:
blender-bot
2023-06-12 00:52:52 +02:00
Referenced by issue #64093, Look Dev Preview's balls are huge! Referenced by issue #64065, Instant Crash upon trying to render in Eevee Referenced by issue #63882, Extremelly slow undo. Referenced by issue #63837, Add-on tabs no longer work Referenced by issue #63806, SurfaceDeform Modifier doesn't render correctly when using Shape Keys Referenced by issue #63772, Movie Clip Editor fails to show/hide toolbar Referenced by issue #63705, Problems Baking Dynamic Paint with two canvases on one object (Blender 2.80)
|
@ -383,18 +383,10 @@ function(setup_liblinks
|
|||
${FREETYPE_LIBRARY}
|
||||
)
|
||||
|
||||
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
|
||||
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
|
||||
target_link_libraries(${target} ${PYTHON_LINKFLAGS})
|
||||
|
||||
if(WIN32 AND NOT UNIX)
|
||||
file_list_suffix(PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d")
|
||||
target_link_libraries_debug(${target} "${PYTHON_LIBRARIES_DEBUG}")
|
||||
target_link_libraries_optimized(${target} "${PYTHON_LIBRARIES}")
|
||||
unset(PYTHON_LIBRARIES_DEBUG)
|
||||
else()
|
||||
target_link_libraries(${target} ${PYTHON_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_PYTHON)
|
||||
target_link_libraries(${target} ${PYTHON_LINKFLAGS})
|
||||
target_link_libraries(${target} ${PYTHON_LIBRARIES})
|
||||
endif()
|
||||
|
||||
if(WITH_LZO AND WITH_SYSTEM_LZO)
|
||||
|
|
|
@ -339,6 +339,8 @@ if(WITH_PYTHON)
|
|||
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
|
||||
# Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
|
||||
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.lib)
|
||||
set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.lib)
|
||||
|
||||
unset(_PYTHON_VERSION_NO_DOTS)
|
||||
|
||||
# Shared includes for both vc2008 and vc2010
|
||||
|
@ -346,7 +348,7 @@ if(WITH_PYTHON)
|
|||
|
||||
# uncached vars
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
||||
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
|
||||
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
|
||||
endif()
|
||||
|
||||
if(WITH_BOOST)
|
||||
|
|
Loading…
Reference in New Issue