|
3 | 3 | # :Author: Ken Robbins <ken@kenrobbins.com> |
4 | 4 | # :License: MIT License |
5 | 5 | # :Copyright: © 2015 Ken Robbins |
6 | | -# :Copyright: © 2016, 2017 Lele Gaifax |
| 6 | +# :Copyright: © 2016, 2017, 2018 Lele Gaifax |
7 | 7 | # |
8 | 8 |
|
9 | 9 | import os.path |
|
29 | 29 |
|
30 | 30 | ROOT_PATH = os.path.abspath(os.path.dirname(__file__)) |
31 | 31 |
|
32 | | -if not os.path.isdir(os.path.join(ROOT_PATH, 'rapidjson', 'include')): |
33 | | - raise RuntimeError("RapidJSON sources not found: if you cloned the git repository," |
34 | | - " you should initialize the rapidjson submodule as explained in" |
35 | | - " the README.rst; in all other cases you may want to report the" |
36 | | - " issue.") |
| 32 | +rj_include_dir = './rapidjson/include' |
| 33 | + |
| 34 | +for idx, arg in enumerate(sys.argv[:]): |
| 35 | + if arg.startswith('--rj-include-dir='): |
| 36 | + sys.argv.pop(idx) |
| 37 | + rj_include_dir = arg.split('=', 1)[1] |
| 38 | + break |
| 39 | +else: |
| 40 | + if not os.path.isdir(os.path.join(ROOT_PATH, 'rapidjson', 'include')): |
| 41 | + raise RuntimeError("RapidJSON sources not found: if you cloned the git" |
| 42 | + " repository, you should initialize the rapidjson submodule" |
| 43 | + " as explained in the README.rst; in all other cases you may" |
| 44 | + " want to report the issue.") |
37 | 45 |
|
38 | 46 | with open('version.txt', encoding='utf-8') as f: |
39 | 47 | VERSION = f.read() |
|
44 | 52 | with open('CHANGES.rst', encoding='utf-8') as f: |
45 | 53 | CHANGES = f.read() |
46 | 54 |
|
47 | | -rj_include_dir = './rapidjson/include' |
48 | | - |
49 | | -for idx, arg in enumerate(sys.argv[:]): |
50 | | - if arg.startswith('--rj-include-dir='): |
51 | | - sys.argv.pop(idx) |
52 | | - rj_include_dir = arg.split('=', 1)[1] |
53 | | - break |
54 | | - |
55 | 55 | extension_options = { |
56 | 56 | 'sources': ['./rapidjson.cpp'], |
57 | 57 | 'include_dirs': [rj_include_dir], |
|
0 commit comments