build: initialize previously uninitialized variables

This commit is contained in:
Gabriel Ferreira
2023-11-18 18:52:50 -03:00
parent b1d70e4561
commit 0f45fcd005
8 changed files with 35 additions and 10 deletions

View File

@@ -23,6 +23,7 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:$ORIGIN/:$ORIGIN/../lib")
# Add the 64 suffix to the library path when manually requested with the
# -DNS3_USE_LIB64=ON flag. May be necessary depending on the target platform.
# This is used to properly build the manylinux pip wheel.
set(NS3_USE_LIB64 FALSE)
if(${NS3_USE_LIB64})
link_directories(${CMAKE_OUTPUT_DIRECTORY}/lib64)
set(CMAKE_INSTALL_RPATH

View File

@@ -95,15 +95,16 @@ function(recursive_dependency module_name)
endif()
# cmake-format: off
# Scan dependencies required by this module examples
#if(${ENABLE_EXAMPLES})
# string(REPLACE "${module_name}" "${module_name}/examples" examples_cmakelists ${examples_cmakelists})
# if(EXISTS ${examples_cmakelists})
# file(READ ${examples_cmakelists} cmakelists_content)
# filter_libraries(${cmakelists_content} example_matches)
# endif()
#endif()
# cmake-format: on
# Scan dependencies required by this module examples
set(example_matches)
#if(${ENABLE_EXAMPLES})
# string(REPLACE "${module_name}" "${module_name}/examples" examples_cmakelists ${examples_cmakelists})
# if(EXISTS ${examples_cmakelists})
# file(READ ${examples_cmakelists} cmakelists_content)
# filter_libraries(${cmakelists_content} example_matches)
# endif()
#endif()
# cmake-format: on
# For each dependency, call this same function
set(matches "${matches};${example_matches}")

View File

@@ -168,6 +168,7 @@ function(build_lib)
add_library(ns3::${lib${BLIB_LIBNAME}} ALIAS ${lib${BLIB_LIBNAME}})
# Associate public headers with library for installation purposes
set(config_headers)
if("${BLIB_LIBNAME}" STREQUAL "core")
set(config_headers ${CMAKE_HEADER_OUTPUT_DIRECTORY}/config-store-config.h
${CMAKE_HEADER_OUTPUT_DIRECTORY}/core-config.h

View File

@@ -542,6 +542,7 @@ macro(process_options)
# GTK3 Don't search for it if you don't have it installed, as it take an
# insane amount of time
set(GTK3_FOUND FALSE)
if(${NS3_GTK3})
disable_cmake_warnings()
find_package(HarfBuzz QUIET)
@@ -609,6 +610,7 @@ macro(process_options)
set(Python3_EXECUTABLE)
set(Python3_FOUND FALSE)
set(Python3_INCLUDE_DIRS)
set(Python3_Interpreter_FOUND FALSE)
if(${NS3_PYTHON_BINDINGS})
find_package(Python3 COMPONENTS Interpreter Development)
else()

View File

@@ -1,3 +1,6 @@
set(gtk3_sources)
set(gtk3_headers)
set(gtk_libraries)
if(${GTK3_FOUND})
set(gtk3_sources
model/display-functions.cc
@@ -21,6 +24,8 @@ if(${GTK3_FOUND})
endif()
endif()
set(xml2_sources)
set(xml2_libraries)
if(${LIBXML2_FOUND})
set(xml2_sources
model/xml-config.cc

View File

@@ -71,6 +71,9 @@ elseif(
)
endif()
set(example_as_test_sources)
set(example_as_test_headers)
set(example_as_test_suite)
if(${ENABLE_EXAMPLES})
set(example_as_test_sources
model/example-as-test.cc

View File

@@ -26,6 +26,9 @@ check_include_file(
)
include(FindPkgConfig)
set(DPDK_INCLUDE_DIRS
""
)
if(PKG_CONFIG_FOUND)
pkg_check_modules(
DPDK
@@ -137,6 +140,8 @@ if(${ENABLE_FDNETDEV})
FdNetDevice
)
set(emu_sources)
set(emu_headers)
if(${ENABLE_EMUNETDEV})
set(emu_sources
helper/emu-fd-net-device-helper.cc
@@ -172,6 +177,8 @@ if(${ENABLE_FDNETDEV})
)
endif()
set(tap_sources)
set(tap_headers)
if(${ENABLE_TAPNETDEV})
set(tap_sources
helper/tap-fd-net-device-helper.cc
@@ -208,6 +215,8 @@ if(${ENABLE_FDNETDEV})
)
endif()
set(netmap_sources)
set(netmap_headers)
if(${ENABLE_NETMAP_EMU})
set(netmap_sources
helper/netmap-net-device-helper.cc
@@ -241,6 +250,9 @@ if(${ENABLE_FDNETDEV})
)
endif()
set(dpdk_sources)
set(dpdk_headers)
set(dpdk_libraries)
if(${ENABLE_DPDKDEVNET})
set(dpdk_sources
model/dpdk-net-device.cc

View File

@@ -1,6 +1,6 @@
set(sqlite_sources)
set(sqlite_headers)
set(private_sqlite_header)
set(private_sqlite_headers)
set(sqlite_libraries)
if(${ENABLE_SQLITE})
set(sqlite_sources