[swift-users] FUSE module for swift

Dennis Schafroth dennis at schafroth.com
Thu Jan 5 17:30:31 CST 2017


I am having trouble using this C API due to use of some build defines, but I could be doing it wrong.

Current trying to compile a test it on macOS with the following modules.map:

module CFuseLinux [system] {
    header "/usr/include/fuse.h"
    link "fuse"
    export *
}

module COSXFuse [system] {
    header "/usr/local/include/fuse.h"
    link "libfuse"
    export *
}

module CFuseBrew [system] {
    header "/usr/local/include/fuse/fuse.h"
    link "libfuse"
    export *
}


Having a test case that simply tries to import the CFuseBrew one:

#if os(Linux) 
import CFuseLinux
#else
import CFuseBrew
#endif

using the following command:

swift test -Xswiftc -DFUSE_USE_VERSION=25 -Xswiftc -D_FILE_OFFSET_BITS=64

But it does not seem that the defines has the effect I want since it fails with: 

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/usr/local/include/fuse/fuse.h"
        ^
/usr/local/include/fuse/fuse.h:26:10: note: in file included from /usr/local/include/fuse/fuse.h:26:
#include "fuse_common.h"
         ^
/usr/local/include/fuse/fuse_common.h:32:2: error: Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
 ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/usr/local/include/fuse/fuse.h"
        ^
/usr/local/include/fuse/fuse.h:26:10: note: in file included from /usr/local/include/fuse/fuse.h:26:
#include "fuse_common.h"
         ^
/usr/local/include/fuse/fuse_common.h:271:8: error: On Darwin API version 25 or greater must be used
#            error On Darwin API version 25 or greater must be used
             ^
/Users/dennis/Projects/cfuse/Tests/CFuseTests/first.swift:5:8: error: could not build Objective-C module 'CFuseBrew'
import CFuseBrew

What am I doing wrong? Is it possible to define build options in modules.map? The project can be found at https://github.com/schafdog/cfuse <https://github.com/schafdog/cfuse>

cheers,
:-Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170106/78bf15ee/attachment.html>


More information about the swift-users mailing list