mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Refactored example build rules to avoid compiler warnings.
This commit is contained in:
		
							parent
							
								
									6a5da9e9c4
								
							
						
					
					
						commit
						b47e9d74e9
					
				
					 1 changed files with 15 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -1578,20 +1578,22 @@ class CppExampleComponent(ExampleComponent):
 | 
			
		|||
    def mk_makefile(self, out):
 | 
			
		||||
        dll_name = get_component(Z3_DLL_COMPONENT).dll_name
 | 
			
		||||
        dll = '%s$(SO_EXT)' % dll_name
 | 
			
		||||
 | 
			
		||||
        objfiles = ''
 | 
			
		||||
        for cppfile in self.src_files():
 | 
			
		||||
            objfile = '%s$(OBJ_EXT)' % (cppfile[:cppfile.rfind('.')])
 | 
			
		||||
            objfiles = objfiles + ('%s ' % objfile)
 | 
			
		||||
            out.write('%s: %s\n' % (objfile, os.path.join(self.to_ex_dir, cppfile)));
 | 
			
		||||
            out.write('\t%s $(CXXFLAGS) $(OS_DEFINES) $(EXAMP_DEBUG_FLAG) $(CXX_OUT_FLAG)%s $(LINK_FLAGS)' % (self.compiler(), objfile))
 | 
			
		||||
            # Add include dir components
 | 
			
		||||
            out.write(' -I%s' % get_component(API_COMPONENT).to_src_dir)
 | 
			
		||||
            out.write(' -I%s' % get_component(CPP_COMPONENT).to_src_dir)
 | 
			
		||||
            out.write(' %s' % cppfile)
 | 
			
		||||
            out.write('\n')            
 | 
			
		||||
        
 | 
			
		||||
        exefile = '%s$(EXE_EXT)' % self.name
 | 
			
		||||
        out.write('%s: %s' % (exefile, dll))
 | 
			
		||||
        for cppfile in self.src_files():
 | 
			
		||||
            out.write(' ')
 | 
			
		||||
            out.write(os.path.join(self.to_ex_dir, cppfile))
 | 
			
		||||
        out.write('\n')
 | 
			
		||||
        out.write('\t%s $(OS_DEFINES) $(EXAMP_DEBUG_FLAG) $(LINK_OUT_FLAG)%s $(LINK_FLAGS)' % (self.compiler(), exefile))
 | 
			
		||||
        # Add include dir components
 | 
			
		||||
        out.write(' -I%s' % get_component(API_COMPONENT).to_src_dir)
 | 
			
		||||
        out.write(' -I%s' % get_component(CPP_COMPONENT).to_src_dir)
 | 
			
		||||
        for cppfile in self.src_files():
 | 
			
		||||
            out.write(' ')
 | 
			
		||||
            out.write(os.path.join(self.to_ex_dir, cppfile))
 | 
			
		||||
        out.write(' ')
 | 
			
		||||
        out.write('%s: %s %s\n' % (exefile, dll, objfiles))
 | 
			
		||||
        out.write('\t$(LINK) $(LINK_OUT_FLAG)%s $(LINK_FLAGS) %s ' % (exefile, objfiles))
 | 
			
		||||
        if IS_WINDOWS:
 | 
			
		||||
            out.write('%s.lib' % dll_name)
 | 
			
		||||
        else:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue