Browse Source

CMake: fix building without HAVE_NET/WANT_NATIVE_NET

rdb 6 years ago
parent
commit
617ef48346

+ 8 - 2
panda/CMakeLists.txt

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

+ 8 - 2
panda/metalibs/panda/CMakeLists.txt

@@ -1,9 +1,15 @@
 set(PANDA_LINK_TARGETS
     p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml
-    p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet
-    p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
+    p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil
+    p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline
     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)
   list(APPEND PANDA_LINK_TARGETS p3audio)
 endif()

+ 6 - 1
panda/src/pstatclient/CMakeLists.txt

@@ -23,7 +23,12 @@ set(P3PSTATCLIENT_SOURCES
 composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES)
 add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT
   ${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)
 
 if(NOT BUILD_METALIBS)