From e3cd658642fcf40c9d27c55076b93640518259c9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 7 Jul 2019 16:08:44 -0600 Subject: [PATCH] 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. --- direct/CMakeLists.txt | 3 +++ direct/src/distributed/CMakeLists.txt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 18847d4b9b..48d563eb06 100644 --- a/direct/CMakeLists.txt +++ b/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") diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index a5486d56c7..26f8f2414b 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/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