From 896a8dbca5776877bdb0c794c9c4f159f2f0f16e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Aug 2019 19:08:30 -0600 Subject: [PATCH] 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) --- dtool/src/interrogate/CMakeLists.txt | 2 +- dtool/src/pystub/CMakeLists.txt | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 86431b2bfa..efa0933717 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -76,7 +76,7 @@ add_custom_command( add_executable(interrogate_module interrogate_module.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) if(NOT CMAKE_CROSSCOMPILING) diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index b4f6f5a4a2..5ae46fed92 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -1,11 +1,18 @@ set(P3PYSTUB_HEADERS pystub.h) set(P3PYSTUB_SOURCES pystub.cxx) -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 - DESTINATION lib - RUNTIME DESTINATION bin - ARCHIVE COMPONENT CoreDevel) +if(WIN32) + # Win32 doesn't actually need this hack + add_library(p3pystub INTERFACE) + +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 + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) + +endif()