platform.py 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright 2013-2017 The Meson development team
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. # http://www.apache.org/licenses/LICENSE-2.0
  6. # Unless required by applicable law or agreed to in writing, software
  7. # distributed under the License is distributed on an "AS IS" BASIS,
  8. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. # See the License for the specific language governing permissions and
  10. # limitations under the License.
  11. # This file contains the detection logic for external dependencies that are
  12. # platform-specific (generally speaking).
  13. from .. import mesonlib
  14. from .base import ExternalDependency, DependencyException
  15. class AppleFrameworks(ExternalDependency):
  16. def __init__(self, env, kwargs):
  17. super().__init__('appleframeworks', env, None, kwargs)
  18. modules = kwargs.get('modules', [])
  19. if isinstance(modules, str):
  20. modules = [modules]
  21. if not modules:
  22. raise DependencyException("AppleFrameworks dependency requires at least one module.")
  23. self.frameworks = modules
  24. # FIXME: Use self.compiler to check if the frameworks are available
  25. for f in self.frameworks:
  26. self.link_args += ['-framework', f]
  27. def found(self):
  28. return mesonlib.is_osx()
  29. def get_version(self):
  30. return 'unknown'