mkmf ignores files in sub-folders when it compiles the C extension

后端 未结 2 1575

I\'d like to organize the C source code like this:

+ /
|
|___ + ext
|    |
|    |___ + native_extension
|         |
|         |___ + lib
|         |    |
|           


        
2条回答
  •  感情败类
    2021-01-05 20:10

    While you can pass a second argument to make_makefile to specify a different source directory (e.g., make_makfile('native_extension', 'lib')), that would cause it not to include your native_extension.c file. Looking at the source for mkmf.rb, it doesn't appear there's any way to make it look in both places short of rewriting the generated Makefile yourself.

提交回复
热议问题