File tree 1 file changed +18
-0
lines changed
source/loaders/c_loader/source
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 35
35
36
36
#include < metacall/metacall.h>
37
37
38
+ #include < iostream>
38
39
#include < iterator>
39
40
#include < map>
40
41
#include < new>
@@ -322,6 +323,23 @@ static loader_impl_c_handle c_loader_impl_handle_create(loader_impl_c c_impl)
322
323
323
324
/* TODO: Take the c_loader and add the execution paths for include (and library?) folders */
324
325
/* tcc_add_include_path, tcc_add_library_path */
326
+ std::string incl_path = c_impl->libtcc_runtime_path ;
327
+ std::string metacall_incl_dir = " include" ;
328
+
329
+ #if defined(_WIN32)
330
+ auto i = incl_path.find_last_of (' \\ ' , incl_path.size () - 3 );
331
+ #else
332
+ auto i = incl_path.find_last_of (' /' , incl_path.size () - 3 );
333
+ #endif
334
+
335
+ incl_path.replace (i + 1 , metacall_incl_dir.size (), metacall_incl_dir);
336
+
337
+ /* Add metacall include path (so this works <metacall/metacall.h>.)*/
338
+ tcc_add_include_path (c_handle->state , incl_path.c_str ());
339
+
340
+ /* Add metacall library path (in other to find libmetacall.so)*/
341
+ tcc_add_library_path (c_handle->state , c_impl->libtcc_runtime_path .c_str ());
342
+
325
343
(void )c_impl;
326
344
327
345
return c_handle;
You can’t perform that action at this time.
0 commit comments