Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/QsCompiler/CSharpGeneration/EntryPoint.fs
Original file line number Diff line number Diff line change
Expand Up @@ -390,14 +390,16 @@ let private driverSettings context =
]
|> immutableList

let assemblyConstant defaultValue name =
context.assemblyConstants.TryGetValue name
|> (fun (_, value) -> if String.IsNullOrWhiteSpace value then defaultValue else value)

let defaultSimulator =
context.assemblyConstants.TryGetValue AssemblyConstants.DefaultSimulator
|> fun (_, value) -> if String.IsNullOrWhiteSpace value then AssemblyConstants.QuantumSimulator else value
assemblyConstant AssemblyConstants.QuantumSimulator AssemblyConstants.DefaultSimulator

let defaultExecutionTarget = assemblyConstant "" AssemblyConstants.ExecutionTarget |> literal

let defaultExecutionTarget =
context.assemblyConstants.TryGetValue AssemblyConstants.ExecutionTarget
|> (fun (_, value) -> if value = null then "" else value)
|> literal
let targetCapability = assemblyConstant "" AssemblyConstants.TargetCapability |> literal

[
namedArg "simulatorOptionAliases" simulatorOptionAliases
Expand All @@ -407,6 +409,7 @@ let private driverSettings context =
namedArg "resourcesEstimatorName" <| literal AssemblyConstants.ResourcesEstimator
namedArg "defaultSimulatorName" <| literal defaultSimulator
namedArg "defaultExecutionTarget" <| defaultExecutionTarget
namedArg "targetCapability" <| targetCapability
namedArg "createDefaultCustomSimulator" <| customSimulatorFactory defaultSimulator
]
|> SyntaxFactory.SeparatedList
Expand Down
1 change: 1 addition & 0 deletions src/QsCompiler/DataStructures/ReservedKeywords.fs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ module AssemblyConstants =
let QCIProcessor = "QCIProcessor"
let QuantinuumProcessor = "QuantinuumProcessor"
let ExecutionTarget = "ExecutionTarget"
let TargetCapability = "TargetCapability"
let DefaultSimulator = "DefaultSimulator"
let QuantumSimulator = "QuantumSimulator"
let SparseSimulator = "SparseSimulator"
Expand Down
1 change: 1 addition & 0 deletions src/QuantumSdk/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
<_QscCommandPredefinedAssemblyProperties>$(_NewLineIndent)AssemblyName:$(PathCompatibleAssemblyName)$(_NewLineIndent)ProcessorArchitecture:$(ResolvedProcessorArchitecture)$(_NewLineIndent)QSharpOutputType:$(ResolvedQSharpOutputType)$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
<_QscCommandPredefinedAssemblyProperties Condition="'$(DefaultSimulator)' != ''">$(_NewLineIndent)DefaultSimulator:$(DefaultSimulator)$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
<_QscCommandPredefinedAssemblyProperties Condition="'$(ExecutionTarget)' != ''">$(_NewLineIndent)ExecutionTarget:$(ExecutionTarget)$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
<_QscCommandPredefinedAssemblyProperties Condition="'$(TargetCapability)' != ''">$(_NewLineIndent)TargetCapability:$(TargetCapability)$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
<_QscCommandPredefinedAssemblyProperties Condition="$(ExposeReferencesViaTestNames)">$(_NewLineIndent)ExposeReferencesViaTestNames:true$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
<_QscCommandPredefinedAssemblyProperties Condition="'$(_QscDocsPackageId)' != ''">$(_NewLineIndent)DocsPackageId:$(_QscDocsPackageId)$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
<_QscCommandPredefinedAssemblyProperties Condition="$(QirGeneration)">$(_NewLineIndent)QirOutputPath:"$(QirOutputPath)"$(_QscCommandPredefinedAssemblyProperties)</_QscCommandPredefinedAssemblyProperties>
Expand Down