Include symbols from fdb_c_internal.h to C bindings client library for Apple platform (#7292)
This commit is contained in:
parent
8cc51064a5
commit
138618eef9
|
@ -58,8 +58,9 @@ if(APPLE)
|
|||
add_custom_command(OUTPUT ${symbols}
|
||||
COMMAND $<TARGET_FILE:Python::Interpreter> ${CMAKE_CURRENT_SOURCE_DIR}/symbolify.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c_internal.h
|
||||
${symbols}
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/symbolify.py ${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c.h
|
||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/symbolify.py ${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c.h ${CMAKE_CURRENT_SOURCE_DIR}/foundationdb/fdb_c_internal.h
|
||||
COMMENT "Generate exported_symbols_list")
|
||||
add_custom_target(exported_symbols_list DEPENDS ${symbols})
|
||||
add_dependencies(fdb_c exported_symbols_list)
|
||||
|
|
|
@ -2,9 +2,13 @@ if __name__ == '__main__':
|
|||
import re
|
||||
import sys
|
||||
r = re.compile('DLLEXPORT[^(]*(fdb_[^(]*)[(]')
|
||||
(fdb_c_h, symbols_file) = sys.argv[1:]
|
||||
with open(fdb_c_h, 'r') as f:
|
||||
symbols = sorted(set('_' + m.group(1) for m in r.finditer(f.read())))
|
||||
header_files = sys.argv[1:-1]
|
||||
symbols_file = sys.argv[-1]
|
||||
symbols = set()
|
||||
for header_file in header_files:
|
||||
with open(header_file, 'r') as f:
|
||||
symbols.update('_' + m.group(1) for m in r.finditer(f.read()))
|
||||
symbols = sorted(symbols)
|
||||
with open(symbols_file, 'w') as f:
|
||||
f.write('\n'.join(symbols))
|
||||
f.write('\n')
|
||||
|
|
Loading…
Reference in New Issue