Skip to content

Commit

Permalink
Added new missing modules check.
Browse files Browse the repository at this point in the history
Only modules required for compilation are checked.

Signed-off-by: D-a-n-i-l-o <D-a-n-i-l-o@users.noreply.github.com>
  • Loading branch information
D-a-n-i-l-o committed Jul 1, 2021
1 parent 72fc274 commit 8866bf6
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion src/wake/buildproduct.wx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ Class BuildProduct
Next

srcs.AddAll( SRC_FILES )

CheckModules()

Build( srcs )
End
Expand Down Expand Up @@ -288,7 +290,56 @@ Class BuildProduct
End

End


Method CheckModules()
'Print "Checking Modules..."

'
' Check that required modules are available when building app or module
' - the binary library: imp.afile
' - the source header: imp.rfile
'
If opts.productType="app" Or opts.productType="module"
Local missingModules:String
Local missingModulesCount:Int = 0

'Print " Imports:"
For Local imp := Eachin imports
'Print " Name: "+imp.name
'Print " afile: "+imp.afile
'Print " rfile: "+imp.rfile
If Not GetFileType( imp.afile ) = FileType.File Or Not GetFileType( imp.rfile ) = FileType.File

If missingModules Then missingModules += ", "
missingModules += imp.name
missingModulesCount += 1

Endif
Next

If missingModules
Local m := "module" ' "module"
If missingModulesCount > 1 Then m += "s" ' "modules"

Local mmode:String ' module mode: "release" or "debug"
If opts.config="release" Then mmode = "release" Else mmode = "debug"

Throw New BuildEx( "~n- Missing "+m+" for target="+opts.target+", config="+mmode+": '"+
missingModules+"'.~n- Please rebuild required "+m+
" using: wake mods -clean -target="+opts.target+" -config="+mmode+" "+missingModules.Replace(",","") )
Endif
Endif

'Print " OBJ_FILES:"
'For Local obj := Eachin OBJ_FILES
' Print " "+obj
'Next

'Print " LIB_FILES:"
'For Local lib := Eachin LIB_FILES
' Print " "+lib
'Next
End
End

Class GccBuildProduct Extends BuildProduct
Expand Down

0 comments on commit 8866bf6

Please sign in to comment.