2012-03-15 29 views
2

我有一個很大的項目,我剛剛添加了一些XS代碼,我想盡可能保持頂層目錄的清潔。我想把XS文件和typemap等。進入一個子目錄,但如果我這樣做,MakeMaker找不到它們。所以現在,他們只是坐在項目的根部。如何告訴MakeMaker在子目錄中構建XS文件?

如何告訴MakeMaker在XS東西的子目錄中查看,以便從那裏構建它?

+0

@schwern - 感謝您的回答 - 我完全錯過了EUMM文檔中的該選項。我只想補充一點,我最終轉而使用[Module :: Build](http://metacpan.org/module/Module::Build),因爲[Module :: Build :: WithXSpp](http:// metacpan .org/module/Module :: Build :: WithXSpp)使許多其他事情變得更加容易。切換也很容易,因爲我正在使用[Dist :: Zilla](http://metacpan.org/module/Dist::Zilla)。 [Dist :: Zilla :: Plugin :: ModuleBuild :: Custom](http://metacpan.org/module/Dist::Zilla::Plugin::ModuleBuild::Custom)模塊也幫助了很多! :) – Hercynium 2012-03-30 14:48:41

回答

4

我相信,如果您將.xs文件放入lib目錄,MakeMaker會找到它們。

你可以明確地告訴MakeMaker的其中.xs文件,什麼.c文件把它翻譯成使用XS選項WriteMakefile

WriteMakefile(
    NAME => "Foo::Bar", 
    XS  => { 
     "lib/Foo/Bar.xs" => "lib/Foo/Bar.c", 
    } 
); 
相關問題