CMake: Some more changes to p3pystub

- Don't build it at all on Win32 where it isn't needed
- Don't link it into interrogate_module (oops, missed that)
This commit is contained in:
Sam Edwards 2019-08-21 19:08:30 -06:00
parent c16092fe8a
commit 896a8dbca5
2 changed files with 16 additions and 9 deletions

View File

@ -76,7 +76,7 @@ add_custom_command(
add_executable(interrogate_module interrogate_module.cxx add_executable(interrogate_module interrogate_module.cxx
${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx) ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx)
target_link_libraries(interrogate_module p3cppParser p3dtoolconfig p3pystub target_link_libraries(interrogate_module p3cppParser p3dtoolconfig
PKG::OPENSSL) PKG::OPENSSL)
if(NOT CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING)

View File

@ -1,11 +1,18 @@
set(P3PYSTUB_HEADERS pystub.h) set(P3PYSTUB_HEADERS pystub.h)
set(P3PYSTUB_SOURCES pystub.cxx) set(P3PYSTUB_SOURCES pystub.cxx)
add_library(p3pystub ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) if(WIN32)
target_link_libraries(p3pystub p3dtool) # Win32 doesn't actually need this hack
install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) add_library(p3pystub INTERFACE)
install(TARGETS p3pystub
else()
add_library(p3pystub ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES})
target_link_libraries(p3pystub p3dtool)
install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d)
install(TARGETS p3pystub
EXPORT Core COMPONENT Core EXPORT Core COMPONENT Core
DESTINATION lib DESTINATION lib
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
ARCHIVE COMPONENT CoreDevel) ARCHIVE COMPONENT CoreDevel)
endif()