Skip to content

Commit 7f3e20a

Browse files
committed
tools: fixes for windows locations
1 parent 4deb539 commit 7f3e20a

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

tools/generate_func.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,27 @@
1111
# FIXME: don't return number of elements since it always equals allocation?
1212

1313
functions = []
14-
include_paths = ['/usr/include', '/usr/local/include', '/opt/include', '/opt/local/include', '/opt/homebrew/include']
1514
if sys.platform == 'win32':
16-
include_paths = [r'c:\ta-lib\c\include']
15+
include_dirs = [
16+
r"c:\ta-lib\c\include",
17+
r"c:\Program Files\TA-Lib\include",
18+
r"c:\Program Files (x86)\TA-Lib\include",
19+
]
20+
else:
21+
include_dirs = [
22+
'/usr/include',
23+
'/usr/local/include',
24+
'/opt/include',
25+
'/opt/local/include',
26+
'/opt/homebrew/include',
27+
'/opt/homebrew/opt/ta-lib/include',
28+
]
29+
30+
if 'TA_INCLUDE_PATH' in os.environ:
31+
include_dirs = os.environ['TA_INCLUDE_PATH'].split(os.pathsep)
32+
1733
header_found = False
18-
for path in include_paths:
34+
for path in include_dirs:
1935
ta_func_header = os.path.join(path, 'ta-lib', 'ta_func.h')
2036
if os.path.exists(ta_func_header):
2137
header_found = True

tools/generate_stream.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,27 @@
1111
# FIXME: don't return number of elements since it always equals allocation?
1212

1313
functions = []
14-
include_paths = ['/usr/include', '/usr/local/include', '/opt/include', '/opt/local/include', '/opt/homebrew/include']
1514
if sys.platform == 'win32':
16-
include_paths = [r'c:\ta-lib\c\include']
15+
include_dirs = [
16+
r"c:\ta-lib\c\include",
17+
r"c:\Program Files\TA-Lib\include",
18+
r"c:\Program Files (x86)\TA-Lib\include",
19+
]
20+
else:
21+
include_dirs = [
22+
'/usr/include',
23+
'/usr/local/include',
24+
'/opt/include',
25+
'/opt/local/include',
26+
'/opt/homebrew/include',
27+
'/opt/homebrew/opt/ta-lib/include',
28+
]
29+
30+
if 'TA_INCLUDE_PATH' in os.environ:
31+
include_dirs = os.environ['TA_INCLUDE_PATH'].split(os.pathsep)
32+
1733
header_found = False
18-
for path in include_paths:
34+
for path in include_dirs:
1935
ta_func_header = os.path.join(path, 'ta-lib', 'ta_func.h')
2036
if os.path.exists(ta_func_header):
2137
header_found = True

0 commit comments

Comments
 (0)