fix totally invalid import of an import

MachineChoice is a mesonlib object, not a compilers object, so it makes
no sense to import it from the latter simply because the latter imports
it too. This results in brittle module dependencies and everything
breaking when a refactor removes it from the latter.

... also it is a typing-only import so while we are fixing it to import
from the right place, we can also put it in a type-checking block.
pull/10489/head
Eli Schwartz 2 years ago
parent 075ccc68be
commit 46148f923b
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      mesonbuild/compilers/cs.py

@ -11,6 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import annotations
import os.path, subprocess
import textwrap
@ -19,12 +20,13 @@ import typing as T
from ..mesonlib import EnvironmentException
from ..linkers import RSPFileSyntax
from .compilers import Compiler, MachineChoice, mono_buildtype_args
from .compilers import Compiler, mono_buildtype_args
from .mixins.islinker import BasicLinkerIsCompilerMixin
if T.TYPE_CHECKING:
from ..envconfig import MachineInfo
from ..environment import Environment
from ..mesonlib import MachineChoice
cs_optimization_args = {'0': [],
'g': [],

Loading…
Cancel
Save