aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-06-14 07:11:02 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-07-03 14:11:31 -0400
commit46148f923b196e1b1d004e68d43edc2daca4dd25 (patch)
tree60003ed1f149bbc61a2d5fd8226268f17868c052 /mesonbuild/compilers
parent075ccc68bec1f3eb74e2089950b48627811354ac (diff)
downloadmeson-46148f923b196e1b1d004e68d43edc2daca4dd25.zip
meson-46148f923b196e1b1d004e68d43edc2daca4dd25.tar.gz
meson-46148f923b196e1b1d004e68d43edc2daca4dd25.tar.bz2
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.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r--mesonbuild/compilers/cs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py
index b38f626..9690cdb 100644
--- a/mesonbuild/compilers/cs.py
+++ b/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': [],