@@ -1217,7 +1217,7 @@ def get_dependencies(file, env, exts, headers, sources, others):
1217
1217
properties .append (
1218
1218
"<ActiveProjectItemList_%s>;%s;</ActiveProjectItemList_%s>" % (x , ";" .join (itemlist [x ]), x )
1219
1219
)
1220
- output = f "bin\\ godot{ env ['PROGSUFFIX' ]} "
1220
+ output = os . path . join ( "bin" , f" godot{ env ['PROGSUFFIX' ]} ")
1221
1221
1222
1222
with open ("misc/msvs/props.template" , "r" , encoding = "utf-8" ) as file :
1223
1223
props_template = file .read ()
@@ -1389,6 +1389,21 @@ def get_dependencies(file, env, exts, headers, sources, others):
1389
1389
proj_template = proj_template .replace ("%%DEFAULT_ITEMS%%" , "\n " .join (all_items ))
1390
1390
proj_template = proj_template .replace ("%%PROPERTIES%%" , "\n " .join (properties ))
1391
1391
1392
+ toolset = "v143"
1393
+ if not env .msvc :
1394
+ toolset = "CLang"
1395
+ proj_template = proj_template .replace ("%%PlatformToolset%%" , toolset )
1396
+
1397
+ if not env .msvc :
1398
+ proplist = [str (j ) for j in env ["CPPPATH" ]]
1399
+ proplist += [str (j ) for j in env .get ("VSHINT_INCLUDES" , [])]
1400
+ proplist += [str (j ) for j in get_default_include_directories (env )]
1401
+ proj_template = proj_template .replace ("%%INCLUDES%%" , ";" .join (proplist ))
1402
+
1403
+ proplist = [format_key_value (v ) for v in list (env ["CPPDEFINES" ])]
1404
+ proplist += [format_key_value (j ) for j in env .get ("VSHINT_DEFINES" , [])]
1405
+ proj_template = proj_template .replace ("%%DEFINES%%" , ";" .join (proplist ))
1406
+
1392
1407
with open (f"{ project_name } .vcxproj" , "w" , encoding = "utf-8" , newline = "\r \n " ) as f :
1393
1408
f .write (proj_template )
1394
1409
@@ -1554,3 +1569,26 @@ def to_raw_cstring(value: Union[str, List[str]]) -> str:
1554
1569
split += [segment ]
1555
1570
1556
1571
return " " .join (f'R"<!>({ x .decode ()} )<!>"' for x in split )
1572
+
1573
+
1574
+ def get_default_include_directories (env ):
1575
+ output = subprocess .Popen (
1576
+ [env ["CXX" ], "-x" , "c++" , "-E" , "-v" , "-" ],
1577
+ stdin = subprocess .DEVNULL ,
1578
+ stdout = subprocess .DEVNULL ,
1579
+ stderr = subprocess .PIPE ,
1580
+ )
1581
+ stderr = output .stderr .read ().decode ()
1582
+ start = False
1583
+ paths = []
1584
+ for line in stderr .splitlines ():
1585
+ line = line .strip () # Remove leading/trailing spaces
1586
+ if not start :
1587
+ if line == "#include <...> search starts here:" :
1588
+ start = True
1589
+ elif start :
1590
+ if line == "End of search list." :
1591
+ break
1592
+ else :
1593
+ paths .append (os .path .abspath (line ))
1594
+ return paths
0 commit comments