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
To pass in the option to Clang, use -Xcc instead of -Xswiftc, like:
swift test -Xswiftc -DFUSE_USE_VERSION=25 -Xcc -D_FILE_OFFSET_BITS=64
As far as in the module map file, I don’t know if that’s supported[1]. You might be able to make your own header that defines it before including fuse.h, and use that for your module.
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