mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	Fix issue on non-windows systems when emitting the build rule
for the ".NET" bindings example. Previously there was a hack that would to path separator replacement ( '/' -> '\' ) which breaks paths under non-windows platforms. The hack has been made slightly better by doing ( '/' -> os.path.sep). This preserves the existing behaviour under Windows and unbreaks the build on non-windows platforms. I'm not entirely sure why the path replacement needs to be done in the first place. I thought Windows was supposed to support using '/' as a path separator (as well as '/'). Maybe ``csc.exe`` doesn't support these kind of paths?
This commit is contained in:
		
							parent
							
								
									44393b37de
								
							
						
					
					
						commit
						439d8d8afe
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
					@ -1969,9 +1969,11 @@ class DotNetExampleComponent(ExampleComponent):
 | 
				
			||||||
                out.write(' /platform:x86')
 | 
					                out.write(' /platform:x86')
 | 
				
			||||||
            for csfile in get_cs_files(self.ex_dir):
 | 
					            for csfile in get_cs_files(self.ex_dir):
 | 
				
			||||||
                out.write(' ')
 | 
					                out.write(' ')
 | 
				
			||||||
                # HACK
 | 
					                # HACK: I'm not really sure why csc on Windows need to be
 | 
				
			||||||
                win_ex_dir = self.to_ex_dir.replace('/', '\\')
 | 
					                # given Windows style paths (``\``) here. I thought Windows
 | 
				
			||||||
                out.write(os.path.join(win_ex_dir, csfile))
 | 
					                # supported using ``/`` as a path separator...
 | 
				
			||||||
 | 
					                relative_path = self.to_ex_dir.replace('/', os.path.sep)
 | 
				
			||||||
 | 
					                out.write(os.path.join(relative_path, csfile))
 | 
				
			||||||
            out.write('\n')
 | 
					            out.write('\n')
 | 
				
			||||||
            out.write('_ex_%s: %s\n\n' % (self.name, exefile))
 | 
					            out.write('_ex_%s: %s\n\n' % (self.name, exefile))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue