From 4af4c484585248e1236d052f0da9de4fbde211da Mon Sep 17 00:00:00 2001 From: Gabriel Ferreira Date: Fri, 24 Jan 2025 13:00:37 +0100 Subject: [PATCH] build: Add msbuild and Visual Studio generator support to the ns3 script --- ns3 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ns3 b/ns3 index 90121cc49..60d3d44bf 100755 --- a/ns3 +++ b/ns3 @@ -771,7 +771,12 @@ def search_cmake_cache(build_profile): if not current_cmake_generator: # Search for available generators - cmake_generator_map = {"ninja": "Ninja", "make": "Unix Makefiles", "xcodebuild": "Xcode"} + cmake_generator_map = { + "msbuild": "Visual Studio 17 2022", + "ninja": "Ninja", + "make": "Unix Makefiles", + "xcodebuild": "Xcode", + } available_generators = [] for generator in cmake_generator_map.keys(): if shutil.which(generator): @@ -949,6 +954,8 @@ def configure_cmake( # Try to set specified generator (will probably fail if there is an old cache) if args.G: cmake_args.extend(["-G", args.G]) + if "Visual Studio" in args.G: + cmake_args.extend(["-A", "x64", "-T", "ClangCL"]) if args.trace_cmake_perf: cmake_performance_trace = os.path.join(