diff options
author | Patrick Lehmann <Patrick.Lehmann@tu-dresden.de> | 2016-10-14 14:17:13 +0200 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@tu-dresden.de> | 2016-10-14 14:17:13 +0200 |
commit | d1fb7f9772ec1a4fafb39c75a52ef064b6467398 (patch) | |
tree | b7cca307b5a467980b70e7677a6c8a23084b1e05 /dist/mcode | |
parent | 1a1d378dcafeca5a18dfa8862ebe412efa1e9718 (diff) | |
download | ghdl-d1fb7f9772ec1a4fafb39c75a52ef064b6467398.tar.gz ghdl-d1fb7f9772ec1a4fafb39c75a52ef064b6467398.tar.bz2 ghdl-d1fb7f9772ec1a4fafb39c75a52ef064b6467398.zip |
Windows Build Flow: Fixed error of premature module unload.
Diffstat (limited to 'dist/mcode')
-rw-r--r-- | dist/mcode/winbuild.ps1 | 3 | ||||
-rw-r--r-- | dist/mcode/windows/compile-ghdl.ps1 | 22 | ||||
-rw-r--r-- | dist/mcode/windows/compile-libraries.ps1 | 13 | ||||
-rw-r--r-- | dist/mcode/windows/shared.psm1 | 19 |
4 files changed, 23 insertions, 34 deletions
diff --git a/dist/mcode/winbuild.ps1 b/dist/mcode/winbuild.ps1 index 6f6a49375..83a3085c5 100644 --- a/dist/mcode/winbuild.ps1 +++ b/dist/mcode/winbuild.ps1 @@ -92,12 +92,13 @@ $GHDLRootDir = Convert-Path (Resolve-Path ($PSScriptRoot + "\" + $RelPathToRo # set default values
$EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent
$EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent
+$Hosting = $true
# Write-Host ("--> " + $Verbose + " value: " +$PSCmdlet.MyInvocation.BoundParameters["Verbose"] + " IsPresent: " + $PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent)
# Write-Host ("--> " + $PSCommandPath + " " + $PSBoundParameters + " " + $PSCmdlet + " " + $PSDefaultParameterValues)
# load modules from GHDL's 'libraries' directory
-Import-Module $PSScriptRoot\windows\shared.psm1 -Verbose:$false -ArgumentList "$Script_WorkingDir"
+Import-Module $PSScriptRoot\windows\shared.psm1 -Verbose:$false -ArgumentList "$Script_WorkingDir", $Hosting
Import-Module $PSScriptRoot\windows\targets.psm1 -Verbose:$false
# Display help if no command was selected
diff --git a/dist/mcode/windows/compile-ghdl.ps1 b/dist/mcode/windows/compile-ghdl.ps1 index 5017b1fee..657023d03 100644 --- a/dist/mcode/windows/compile-ghdl.ps1 +++ b/dist/mcode/windows/compile-ghdl.ps1 @@ -46,29 +46,29 @@ [CmdletBinding()] param( # Display this help" - [switch]$Help = $false, + [switch]$Help = $false, # Slean up all files and directories - [switch]$Clean = $false, - [switch]$Clean_GHDL = $false, + [switch]$Clean = $false, + [switch]$Clean_GHDL = $false, # Compile all targets - [switch]$All = $false, + [switch]$All = $false, # Compile main targets - [switch]$Compile = $false, + [switch]$Compile = $false, # Compile GHDL (simulator) - [switch]$Compile_GHDL = $false, + [switch]$Compile_GHDL = $false, # Undocumented - [switch]$Test = $false, + [switch]$Test = $false, # Undocumented - [switch]$Test_GHDL = $false, + [switch]$Test_GHDL = $false, # Build options # Build a release version - [switch]$Release = $false, + [switch]$Release = $false, # Set the back-end - [string]$Backend = "mcode", + [string]$Backend = "mcode", # Reduced messages [switch]$Quiet = $false, @@ -97,7 +97,7 @@ $EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent # Write-Host ("--> " + $PSCommandPath + " " + $PSBoundParameters + " " + $PSCmdlet + " " + $PSDefaultParameterValues) # load modules from GHDL's 'libraries' directory -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList "$Script_WorkingDir" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList "$Script_WorkingDir", $Hosted Import-Module $PSScriptRoot\targets.psm1 -Verbose:$false # Display help if no command was selected diff --git a/dist/mcode/windows/compile-libraries.ps1 b/dist/mcode/windows/compile-libraries.ps1 index 01ab7712b..73e1cf766 100644 --- a/dist/mcode/windows/compile-libraries.ps1 +++ b/dist/mcode/windows/compile-libraries.ps1 @@ -91,22 +91,11 @@ $EnableVerbose = $PSCmdlet.MyInvocation.BoundParameters["Verbose"].IsPresent $EnableDebug = $PSCmdlet.MyInvocation.BoundParameters["Debug"].IsPresent # load modules from GHDL's 'libraries' directory -Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList "$Script_WorkingDir" +Import-Module $PSScriptRoot\shared.psm1 -Verbose:$false -ArgumentList "$Script_WorkingDir", $Hosted # Display help if no command was selected $Help = $Help -or (-not ($Compile -or $VHDL87 -or $VHDL93 -or $VHDL2008 -or $Clean)) -function Exit-CompileScript -{ [CmdletBinding()] - param( - [int]$ExitCode = 0 - ) - cd $Script_WorkingDir - # unload modules - Remove-Module shared -Verbose:$false - exit $ExitCode -} - if ($Help) { Get-Help $MYINVOCATION.InvocationName -Detailed Exit-CompileScript diff --git a/dist/mcode/windows/shared.psm1 b/dist/mcode/windows/shared.psm1 index e39ce67ce..81a11be82 100644 --- a/dist/mcode/windows/shared.psm1 +++ b/dist/mcode/windows/shared.psm1 @@ -32,19 +32,19 @@ [CmdletBinding()] param( - [Parameter(Mandatory=$true)][string]$WorkingDir + [Parameter(Mandatory=$true)][string]$WorkingDir, + [Parameter(Mandatory=$true)][Switch]$Hosted ) -$Module_WorkingDir = $WorkingDir +$Module_WorkingDir = $WorkingDir +$Module_Hosted = $Hosted function Exit-CompileScript -{ <# +{ <# .SYNOPSIS Undocumented - .DESCRIPTION Undocumented - .PARAMETER ExitCode ExitCode of this script run #> @@ -52,13 +52,12 @@ function Exit-CompileScript param( [int]$ExitCode = 0 ) - cd $Module_WorkingDir - # unload modules - Remove-Module shared -Verbose:$false - Remove-Module targets -Verbose:$false - + if (-not $Module_Hosted) + { Remove-Module shared -Verbose:$false + Remove-Module targets -Verbose:$false + } exit $ExitCode } |