lundi 5 février 2018

module.modulemap "requires cplusplus11" causes building failure

I am using Swift 4 to build a C++11 module by adding the flags like this:

swift build -Xcxx -std=c++11

It works pretty well.

However, if adding requires cplusplus11 to the module map to save these flags then it stops building immediately:

https://github.com/RockfordWei/csweet/blob/master/Sources/csweet/include/module.modulemap#L2

module csweet [system] {
  requires cplusplus11
  header "csweet.h"
  export *
}

`<unknown>:0: error: module 'xxxx' requires feature 'cplusplus11'`

I've been reading this all the time: https://clang.llvm.org/docs/Modules.html#requires-declaration

but still cannot figure it out the best practice to allow Swift to umbrella a higher dialect C++ (11/14/17) module other than the native 98/03.

Thoughts??

Aucun commentaire:

Enregistrer un commentaire