Add schema for compiler options in packages.yaml (#45738)
This commit is contained in:
parent
7b10aae356
commit
97ffe2e575
@ -11,6 +11,26 @@
|
|||||||
|
|
||||||
import spack.schema.environment
|
import spack.schema.environment
|
||||||
|
|
||||||
|
flags: Dict[str, Any] = {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": False,
|
||||||
|
"properties": {
|
||||||
|
"cflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
|
"cxxflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
|
"fflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
|
"cppflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
|
"ldflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
|
"ldlibs": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extra_rpaths: Dict[str, Any] = {"type": "array", "default": [], "items": {"type": "string"}}
|
||||||
|
|
||||||
|
implicit_rpaths: Dict[str, Any] = {
|
||||||
|
"anyOf": [{"type": "array", "items": {"type": "string"}}, {"type": "boolean"}]
|
||||||
|
}
|
||||||
|
|
||||||
#: Properties for inclusion in other schemas
|
#: Properties for inclusion in other schemas
|
||||||
properties: Dict[str, Any] = {
|
properties: Dict[str, Any] = {
|
||||||
"compilers": {
|
"compilers": {
|
||||||
@ -35,18 +55,7 @@
|
|||||||
"fc": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
"fc": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"flags": {
|
"flags": flags,
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": False,
|
|
||||||
"properties": {
|
|
||||||
"cflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
|
||||||
"cxxflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
|
||||||
"fflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
|
||||||
"cppflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
|
||||||
"ldflags": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
|
||||||
"ldlibs": {"anyOf": [{"type": "string"}, {"type": "null"}]},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"spec": {"type": "string"},
|
"spec": {"type": "string"},
|
||||||
"operating_system": {"type": "string"},
|
"operating_system": {"type": "string"},
|
||||||
"target": {"type": "string"},
|
"target": {"type": "string"},
|
||||||
@ -54,18 +63,9 @@
|
|||||||
"modules": {
|
"modules": {
|
||||||
"anyOf": [{"type": "string"}, {"type": "null"}, {"type": "array"}]
|
"anyOf": [{"type": "string"}, {"type": "null"}, {"type": "array"}]
|
||||||
},
|
},
|
||||||
"implicit_rpaths": {
|
"implicit_rpaths": implicit_rpaths,
|
||||||
"anyOf": [
|
|
||||||
{"type": "array", "items": {"type": "string"}},
|
|
||||||
{"type": "boolean"},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"environment": spack.schema.environment.definition,
|
"environment": spack.schema.environment.definition,
|
||||||
"extra_rpaths": {
|
"extra_rpaths": extra_rpaths,
|
||||||
"type": "array",
|
|
||||||
"default": [],
|
|
||||||
"items": {"type": "string"},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
import spack.schema.environment
|
import spack.schema.environment
|
||||||
|
|
||||||
|
from .compilers import extra_rpaths, flags, implicit_rpaths
|
||||||
|
|
||||||
permissions = {
|
permissions = {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": False,
|
"additionalProperties": False,
|
||||||
@ -184,7 +186,16 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": True,
|
"additionalProperties": True,
|
||||||
"properties": {
|
"properties": {
|
||||||
"environment": spack.schema.environment.definition
|
"compilers": {
|
||||||
|
"type": "object",
|
||||||
|
"patternProperties": {
|
||||||
|
r"(^\w[\w-]*)": {"type": "string"}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"environment": spack.schema.environment.definition,
|
||||||
|
"extra_rpaths": extra_rpaths,
|
||||||
|
"implicit_rpaths": implicit_rpaths,
|
||||||
|
"flags": flags,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user