build: Remove C dependency

This commit is contained in:
Gabriel Ferreira
2025-05-16 12:14:50 +02:00
parent 2fc24282e3
commit 08b72c4438
4 changed files with 12 additions and 15 deletions

View File

@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.20..3.20)
# ##############################################################################
# Project name #
# ##############################################################################
project(NS3 CXX C)
project(NS3 CXX)
file(STRINGS VERSION NS3_VER)

View File

@@ -60,7 +60,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Include CMake files used for compiler checks
include(CheckIncludeFile) # Used to check a single C header at a time
include(CheckIncludeFileCXX) # Used to check a single C++ header at a time
include(CheckIncludeFiles) # Used to check multiple headers at once
include(CheckFunctionExists)
@@ -1129,11 +1128,11 @@ macro(process_options)
# Check for required headers and functions, set flags if they're found or warn
# if they're not found
check_include_file("sys/types.h" "HAVE_SYS_TYPES_H")
check_include_file("sys/stat.h" "HAVE_SYS_STAT_H")
check_include_file("dirent.h" "HAVE_DIRENT_H")
check_include_file("signal.h" "HAVE_SIGNAL_H")
check_include_file("netpacket/packet.h" "HAVE_PACKETH")
check_include_file_cxx("sys/types.h" "HAVE_SYS_TYPES_H")
check_include_file_cxx("sys/stat.h" "HAVE_SYS_STAT_H")
check_include_file_cxx("dirent.h" "HAVE_DIRENT_H")
check_include_file_cxx("signal.h" "HAVE_SIGNAL_H")
check_include_file_cxx("netpacket/packet.h" "HAVE_PACKETH")
check_function_exists("getenv" "HAVE_GETENV")
configure_file(

2
ns3
View File

@@ -1179,8 +1179,6 @@ def extract_cmakecache_settings(current_cmake_cache_folder):
current_settings.extend(re.findall("(CMAKE_GENERATOR):.*=(.*)", contents)) # extract generator
current_settings.extend(re.findall("(CMAKE_CXX_COMPILER):.*=(.*)", contents)) # C++ compiler
current_settings.extend(re.findall("(CMAKE_CXX_FLAGS):.*=(.*)", contents)) # C++ flags
current_settings.extend(re.findall("(CMAKE_C_COMPILER):.*=(.*)", contents)) # C compiler
current_settings.extend(re.findall("(CMAKE_C_FLAGS):.*=(.*)", contents)) # C flags
current_settings.extend(
re.findall("(CMAKE_INSTALL_PREFIX):.*=(.*)", contents)
) # installation directory

View File

@@ -1,26 +1,26 @@
set(module_enabled_features) # modulegen_customizations consumes this list
check_include_file(
check_include_file_cxx(
net/ethernet.h
HAVE_NET_ETHERNET_H
)
check_include_file(
check_include_file_cxx(
netpacket/packet.h
HAVE_PACKET_H
)
check_include_file(
check_include_file_cxx(
net/if.h
HAVE_IF_NETS_H
)
check_include_file(
check_include_file_cxx(
linux/if_tun.h
HAVE_IF_TUN_H
)
check_include_file(
check_include_file_cxx(
net/netmap_user.h
HAVE_NETMAP_USER_H
)
check_include_file(
check_include_file_cxx(
sys/ioctl.h
HAVE_SYS_IOCTL_H
)