@@ -13,24 +13,34 @@ TSKIT_SOURCES = \
1313TSKIT_OBJECTS = $(TSKIT_SOURCES:.c=.o)
1414# $(info TSKIT_OBJECTS = $(TSKIT_OBJECTS)) # for debugging, info is also a GNU extension
1515
16- # tskitr C++ sources & objects
17- # TSKITR_SOURCES = $(wildcard *.cpp) # wildcard is a GNU extension and not desired on CRAN
18- TSKITR_SOURCES = \
16+ # tskitr C/C ++ sources & objects
17+ # TSKITR_CPP_SOURCES = $(wildcard *.cpp) # wildcard is a GNU extension and not desired on CRAN
18+ TSKITR_CPP_SOURCES = \
1919 tskitr.cpp \
20+ test_tsk_bug_assert.cpp \
2021 RcppExports.cpp
21- # $(info TSKITR_SOURCES = $(TSKITR_SOURCES)) # for debugging, info is also a GNU extension
22- TSKITR_OBJECTS = $(TSKITR_SOURCES:.cpp=.o)
22+ # $(info TSKITR_CPP_SOURCES = $(TSKITR_CPP_SOURCES)) # for debugging, info is also a GNU extension
23+ TSKITR_C_SOURCES = \
24+ test_tsk_bug_assert_c.c
25+ # $(info TSKITR_C_SOURCES = $(TSKITR_C_SOURCES)) # for debugging, info is also a GNU extension
26+ TSKITR_OBJECTS = $(TSKITR_CPP_SOURCES:.cpp=.o) $(TSKITR_C_SOURCES:.c=.o)
2327# $(info TSKITR_OBJECTS = $(TSKITR_OBJECTS)) # for debugging, info is also a GNU extension
2428
2529# All objects
2630OBJECTS = $(TSKIT_OBJECTS) $(TSKITR_OBJECTS)
2731# $(info OBJECTS = $(OBJECTS)) # for debugging, info is also a GNU extension
2832
2933# Include paths and preprocessor defines
30- PKG_CPPFLAGS = -I../inst/include -I../inst/include/tskit -I../inst/include/tskit/tskit
34+ # * A bit complicated include/tskit structure due to how we include tskit headers
35+ # * $(R_HOME)/include is for <R_ext/Error.h>
36+ PKG_CPPFLAGS = \
37+ -I../inst/include \
38+ -I../inst/include/tskit \
39+ -I../inst/include/tskit/tskit \
40+ -I$(R_HOME)/include
3141
3242# Compiler flags
33- PKG_CFLAGS = -DNDEBUG # to remove calls to assert()
43+ PKG_CFLAGS = -DNDEBUG # to remove calls to assert() as per the R extensions manual
3444# TODO: Should we port any flags from extern/tskit/c/meson.build to R build system? #6
3545# https://github.com/HighlanderLab/tskitr/issues/6
3646# See default flags used by clang (see below output from devtools::install())
0 commit comments