Skip to content

Commit

Permalink
tools: fixes for windows locations
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Feb 4, 2025
1 parent 4deb539 commit 7f3e20a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
22 changes: 19 additions & 3 deletions tools/generate_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,27 @@
# FIXME: don't return number of elements since it always equals allocation?

functions = []
include_paths = ['/usr/include', '/usr/local/include', '/opt/include', '/opt/local/include', '/opt/homebrew/include']
if sys.platform == 'win32':
include_paths = [r'c:\ta-lib\c\include']
include_dirs = [
r"c:\ta-lib\c\include",
r"c:\Program Files\TA-Lib\include",
r"c:\Program Files (x86)\TA-Lib\include",
]
else:
include_dirs = [
'/usr/include',
'/usr/local/include',
'/opt/include',
'/opt/local/include',
'/opt/homebrew/include',
'/opt/homebrew/opt/ta-lib/include',
]

if 'TA_INCLUDE_PATH' in os.environ:
include_dirs = os.environ['TA_INCLUDE_PATH'].split(os.pathsep)

header_found = False
for path in include_paths:
for path in include_dirs:
ta_func_header = os.path.join(path, 'ta-lib', 'ta_func.h')
if os.path.exists(ta_func_header):
header_found = True
Expand Down
22 changes: 19 additions & 3 deletions tools/generate_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,27 @@
# FIXME: don't return number of elements since it always equals allocation?

functions = []
include_paths = ['/usr/include', '/usr/local/include', '/opt/include', '/opt/local/include', '/opt/homebrew/include']
if sys.platform == 'win32':
include_paths = [r'c:\ta-lib\c\include']
include_dirs = [
r"c:\ta-lib\c\include",
r"c:\Program Files\TA-Lib\include",
r"c:\Program Files (x86)\TA-Lib\include",
]
else:
include_dirs = [
'/usr/include',
'/usr/local/include',
'/opt/include',
'/opt/local/include',
'/opt/homebrew/include',
'/opt/homebrew/opt/ta-lib/include',
]

if 'TA_INCLUDE_PATH' in os.environ:
include_dirs = os.environ['TA_INCLUDE_PATH'].split(os.pathsep)

header_found = False
for path in include_paths:
for path in include_dirs:
ta_func_header = os.path.join(path, 'ta-lib', 'ta_func.h')
if os.path.exists(ta_func_header):
header_found = True
Expand Down

0 comments on commit 7f3e20a

Please sign in to comment.