Skip to content

Commit

Permalink
Use sources.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Sep 5, 2023
1 parent 79d8aa6 commit 29de98a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions rconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def open_utf8(fpath, flags):
with open_utf8(os.path.join('src', 'Makevars.in'), 'r') as f:
text = f.read()

text = text.replace('{{ SOURCES }}', object_list)
text = text.replace('{{ INCLUDES }}', include_list)
if len(libraries) == 0:
text = text.replace('PKG_LIBS={{ LINK_FLAGS }}', '')
Expand All @@ -130,10 +129,15 @@ def open_utf8(fpath, flags):
text = f.read()

include_list += " -DDUCKDB_PLATFORM_RTOOLS=1"
text = text.replace('{{ SOURCES }}', object_list)
text = text.replace('{{ INCLUDES }}', include_list)
text = text.replace('{{ LINK_FLAGS }}', "-lws2_32")

# now write it to the output Makevars
with open_utf8(os.path.join('src', 'Makevars.win'), 'w+') as f:
f.write(text)

# write sources.mk
text = "SOURCES=" + object_list + '\n'

with open_utf8(os.path.join('src', 'sources.mk'), 'w') as f:
f.write(text)
3 changes: 2 additions & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include sources.mk
CXX_STD = CXX17
PKG_CPPFLAGS = -Iinclude -I../inst/include -DDUCKDB_DISABLE_PRINT -DDUCKDB_R_BUILD {{ INCLUDES }}
OBJECTS=database.o connection.o statement.o register.o relational.o scan.o transform.o utils.o reltoaltrep.o types.o cpp11.o {{ SOURCES }}
OBJECTS=database.o connection.o statement.o register.o relational.o scan.o transform.o utils.o reltoaltrep.o types.o cpp11.o $(SOURCES)
PKG_LIBS={{ LINK_FLAGS }}

0 comments on commit 29de98a

Please sign in to comment.