Skip to content

Commit

Permalink
Fix missing method
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Dec 2, 2019
1 parent 3cc0372 commit 691cdf2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,21 @@ class BuildOptionsCommandMixIn(object):
_options = {}
"""Store build option states once for all"""

def get_compiler_flag_prefix(self):
"""Returns compiler flags prefix character ('-' or '/')
:rtype: str
"""
return '/' if self.__get_compiler().compiler_type == 'msvc' else '-'

def select_compiler_flags(self, flags):
"""Removes compiler arguments that are not for the current one.
:param List[str] flags: All compiler arguments
:return: List of arguments for the current compiler
:rtype: List[str]
"""
prefix = '/' if self.__get_compiler().compiler_type == 'msvc' else '-'
prefix = self.get_compiler_flag_prefix()
return [flag for flag in flags if flag.startswith(prefix)]

def has_option(self, option):
Expand Down

0 comments on commit 691cdf2

Please sign in to comment.