diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index 4a49e16c84..6290d69e22 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -58,8 +58,9 @@ if(APPLE) add_custom_command(OUTPUT ${symbols} COMMAND $ ${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) diff --git a/bindings/c/symbolify.py b/bindings/c/symbolify.py index 55d8dc81fd..b0c9dece64 100644 --- a/bindings/c/symbolify.py +++ b/bindings/c/symbolify.py @@ -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')