Skip to content

Commit

Permalink
Try to get max_order from --config-settings if present
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkahn committed Feb 28, 2023
1 parent 173a99a commit fa98633
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ def compile_test(header, library):
# Use an environment variable
max_order = os.getenv("MAX_ORDER", "6")

# Try to get from --config-settings, if present
is_max_order = [s for s in sys.argv if "--max_order" in s]
for element in is_max_order:
max_order = re.split('[= ]',element)[1]
sys.argv.remove(element)

print(f"Will build with KenLM max_order set to {max_order}")

FILES = glob.glob('util/*.cc') + glob.glob('lm/*.cc') + glob.glob('util/double-conversion/*.cc') + glob.glob('python/*.cc')
Expand Down

0 comments on commit fa98633

Please sign in to comment.