Browse Source

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)
Sam Edwards 6 years ago
parent
commit
896a8dbca5
2 changed files with 16 additions and 9 deletions
  1. 1 1
      dtool/src/interrogate/CMakeLists.txt
  2. 15 8
      dtool/src/pystub/CMakeLists.txt

+ 1 - 1
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)

+ 15 - 8
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()