Skip to content

Commit 4af4c48

Browse files
build: Add msbuild and Visual Studio generator support to the ns3 script
1 parent c45d150 commit 4af4c48

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ns3

+8-1
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,12 @@ def search_cmake_cache(build_profile):
771771

772772
if not current_cmake_generator:
773773
# Search for available generators
774-
cmake_generator_map = {"ninja": "Ninja", "make": "Unix Makefiles", "xcodebuild": "Xcode"}
774+
cmake_generator_map = {
775+
"msbuild": "Visual Studio 17 2022",
776+
"ninja": "Ninja",
777+
"make": "Unix Makefiles",
778+
"xcodebuild": "Xcode",
779+
}
775780
available_generators = []
776781
for generator in cmake_generator_map.keys():
777782
if shutil.which(generator):
@@ -949,6 +954,8 @@ def configure_cmake(
949954
# Try to set specified generator (will probably fail if there is an old cache)
950955
if args.G:
951956
cmake_args.extend(["-G", args.G])
957+
if "Visual Studio" in args.G:
958+
cmake_args.extend(["-A", "x64", "-T", "ClangCL"])
952959

953960
if args.trace_cmake_perf:
954961
cmake_performance_trace = os.path.join(

0 commit comments

Comments
 (0)