@@ -42,7 +42,7 @@ require_var(TRUFFLE_H_INC)
42
42
require_var (GRAALPY_EXT )
43
43
44
44
if (NOT DEFINED SRC_DIR )
45
- set (SRC_DIR ". " )
45
+ set (SRC_DIR "${CMAKE_SOURCE_DIR} " )
46
46
endif ()
47
47
48
48
set (TARGET_LIBPYTHON "python" )
@@ -106,9 +106,39 @@ set(SRC_FILES ${CAPI_SRC}/codecs.c ${CAPI_SRC}/setobject.c ${CAPI_SRC}/compile.c
106
106
${CAPI_SRC} /typeobject_shared.c ${CAPI_SRC} /mystrtoul.c ${CAPI_SRC} /weakrefobject.c
107
107
${CAPI_SRC} /modsupport_shared.c ${CAPI_SRC} /fileobject.c ${CAPI_SRC} /pystrcmp.c ${CAPI_SRC} /getversion.c
108
108
${CAPI_SRC} /genobject.c ${CAPI_SRC} /methodobject.c ${CAPI_SRC} /boolobject.c ${CAPI_SRC} /pylifecycle.c
109
- ${CAPI_SRC} /errors.c ${CAPI_SRC} /signals.c ${CAPI_SRC} /datetime.c
109
+ ${CAPI_SRC} /errors.c ${CAPI_SRC} /signals.c ${CAPI_SRC} /datetime.c ${CAPI_SRC} /bytearrayobject_shared.c
110
110
)
111
111
112
+ file (GLOB_RECURSE ACTUAL_SRC_FILES
113
+ LIST_DIRECTORIES FALSE
114
+ "${CAPI_SRC} /*.c" )
115
+
116
+
117
+ function (list_equals lst0 lst1 )
118
+ list (LENGTH ${lst0} len0 )
119
+ list (LENGTH ${lst1} len1 )
120
+ if (NOT len0 EQUAL len1 )
121
+ message (FATAL_ERROR "The list of source files does not match the current file system. "
122
+ "Different number of files: given len = ${len0} ;; actual len = ${len1} " )
123
+ endif ()
124
+
125
+ # sort lists
126
+ list (SORT ${lst0} )
127
+ list (SORT ${lst1} )
128
+
129
+ # iterate over both lists in simultaneously
130
+ foreach (item IN ZIP_LISTS ${lst0} ${lst1} )
131
+ if (NOT ${item_0} STREQUAL ${item_1} )
132
+ message (VERBOSE "given src files = ${lst0} " )
133
+ message (VERBOSE "actual src files = ${lst1} " )
134
+ message (FATAL_ERROR "The list of source files does not match the current file system. "
135
+ "Different items: given file = ${item_0} ;; actual file = ${item_1} " )
136
+ endif ()
137
+ endforeach ()
138
+ endfunction ()
139
+
140
+ list_equals (SRC_FILES ACTUAL_SRC_FILES )
141
+
112
142
include_directories (
113
143
${CAPI_SRC}
114
144
"${SRC_DIR} /include"
0 commit comments