CMake: fix building without HAVE_NET/WANT_NATIVE_NET

This commit is contained in:
rdb 2019-03-17 21:10:55 +01:00
parent 52541825b5
commit 617ef48346
3 changed files with 22 additions and 5 deletions

View File

@ -81,11 +81,17 @@ add_subdirectory(metalibs/pandaphysics)
# Now add the Python modules: # Now add the Python modules:
set(CORE_MODULE_COMPONENTS set(CORE_MODULE_COMPONENTS
p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml
p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil
p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform
p3prc p3dtoolutil p3dtoolbase) p3prc p3dtoolutil p3dtoolbase)
if(WANT_NATIVE_NET)
list(APPEND CORE_MODULE_COMPONENTS p3nativenet)
if(HAVE_NET)
list(APPEND CORE_MODULE_COMPONENTS p3net)
endif()
endif()
if(HAVE_AUDIO) if(HAVE_AUDIO)
list(APPEND CORE_MODULE_COMPONENTS p3audio) list(APPEND CORE_MODULE_COMPONENTS p3audio)
endif() endif()

View File

@ -1,9 +1,15 @@
set(PANDA_LINK_TARGETS set(PANDA_LINK_TARGETS
p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml
p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil
p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform)
if(WANT_NATIVE_NET)
list(APPEND PANDA_LINK_TARGETS p3nativenet)
if(HAVE_NET)
list(APPEND PANDA_LINK_TARGETS p3net)
endif()
endif()
if(HAVE_AUDIO) if(HAVE_AUDIO)
list(APPEND PANDA_LINK_TARGETS p3audio) list(APPEND PANDA_LINK_TARGETS p3audio)
endif() endif()

View File

@ -23,7 +23,12 @@ set(P3PSTATCLIENT_SOURCES
composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES)
add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT
${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES})
target_link_libraries(p3pstatclient p3net p3putil pandaexpress) target_link_libraries(p3pstatclient p3putil pandaexpress)
if(HAVE_NET AND WANT_NATIVE_NET)
target_link_libraries(p3pstatclient p3net)
endif()
target_interrogate(p3pstatclient ALL) target_interrogate(p3pstatclient ALL)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)