Browse Source

CMake: C++ code in direct.distributed should be an extension

This code is so heavily dependent on Python (and makepanda
doesn't even build it into libp3direct) that we shouldn't
even try to put it in the libp3direct library ourselves.
Sam Edwards 6 years ago
parent
commit
e3cd658642
2 changed files with 7 additions and 4 deletions
  1. 3 0
      direct/CMakeLists.txt
  2. 4 4
      direct/src/distributed/CMakeLists.txt

+ 3 - 0
direct/CMakeLists.txt

@@ -20,6 +20,9 @@ set(P3DIRECT_COMPONENTS
 )
 if(HAVE_PYTHON)
   list(APPEND P3DIRECT_COMPONENTS p3distributed)
+  get_target_property(_p3distributed_exts p3distributed IGATE_EXTENSIONS)
+  set_source_files_properties(${_p3distributed_exts}
+    PROPERTIES COMPILE_DEFINITIONS BUILDING_DIRECT_DISTRIBUTED)
 endif()
 
 set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "DirectDevel")

+ 4 - 4
direct/src/distributed/CMakeLists.txt

@@ -16,10 +16,10 @@ set(P3DISTRIBUTED_SOURCES
   cDistributedSmoothNodeBase.cxx
 )
 
-add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED
-  ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES})
-target_link_libraries(p3distributed p3directbase p3dcparser panda PKG::PYTHON)
-target_interrogate(p3distributed ALL)
+add_component_library(p3distributed NOINIT SYMBOL BUILDING_DIRECT_DISTRIBUTED
+  ${P3DISTRIBUTED_HEADERS})
+target_link_libraries(p3distributed p3directbase p3dcparser panda)
+target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_SOURCES})
 
 if(NOT BUILD_METALIBS)
   install(TARGETS p3distributed