build: check if visualizer is in the enabled modules list
This commit is contained in:
@@ -440,7 +440,7 @@ function(build_lib)
|
||||
|
||||
# Make sure all bindings are built before building the visualizer module
|
||||
# that makes use of them
|
||||
if(${ENABLE_VISUALIZER})
|
||||
if(${ENABLE_VISUALIZER} AND (visualizer IN_LIST libs_to_build))
|
||||
if(NOT (${BLIB_LIBNAME} STREQUAL visualizer))
|
||||
add_dependencies(${libvisualizer} ${bindings-name})
|
||||
endif()
|
||||
|
||||
@@ -1030,7 +1030,7 @@ macro(process_options)
|
||||
endforeach()
|
||||
|
||||
unset(optional_visualizer_lib)
|
||||
if(${ENABLE_VISUALIZER})
|
||||
if(${ENABLE_VISUALIZER} AND (visualizer IN_LIST libs_to_build))
|
||||
set(optional_visualizer_lib ${libvisualizer})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
set(libs "${libs_to_build}")
|
||||
|
||||
# Process the visualizer module first if enabled
|
||||
if(${ENABLE_VISUALIZER})
|
||||
message(STATUS "Processing src/visualizer")
|
||||
add_subdirectory(visualizer)
|
||||
if(visualizer IN_LIST libs)
|
||||
if(${ENABLE_VISUALIZER})
|
||||
message(STATUS "Processing src/visualizer")
|
||||
add_subdirectory(visualizer)
|
||||
endif()
|
||||
list(REMOVE_ITEM libs visualizer)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -539,8 +539,13 @@ class NS3ConfigureTestCase(NS3BaseTestCase):
|
||||
self.assertIn("ns3-network", enabled_modules)
|
||||
self.assertIn("ns3-wifi", enabled_modules)
|
||||
|
||||
# Try enabling only core
|
||||
return_code, stdout, stderr = run_ns3("configure --enable-modules='core' --enable-python-bindings")
|
||||
self.config_ok(return_code, stdout)
|
||||
self.assertIn("ns3-core", get_enabled_modules())
|
||||
|
||||
# Try cleaning the list of enabled modules to reset to the normal configuration.
|
||||
return_code, stdout, stderr = run_ns3("configure --enable-modules=''")
|
||||
return_code, stdout, stderr = run_ns3("configure --enable-modules='' --disable-python-bindings")
|
||||
self.config_ok(return_code, stdout)
|
||||
|
||||
# At this point we should have the same amount of modules that we had when we started.
|
||||
|
||||
Reference in New Issue
Block a user