Code Monkey home page Code Monkey logo

Comments (5)

DanAlbert avatar DanAlbert commented on July 18, 2024

What's the actual shipped artifact here? The CMake article doesn't say.

https://stackoverflow.com/a/73601836 says that modules are not ready for binary distribution.

from prefab.

yujincheng08 avatar yujincheng08 commented on July 18, 2024

@DanAlbert Still .so or .a for a library. And the files in FILE_SET in type CXX_MODULES for cmake (module interface unit, files that declare export a module). You can verify this by performing a cmake install on a cmake project that uses c++ modules.

from prefab.

DanAlbert avatar DanAlbert commented on July 18, 2024

But you're asking for a change in the distributed artifacts here. Which additional artifacts need to be distributed? As best as I can tell from the article you linked, it's source.

from prefab.

yujincheng08 avatar yujincheng08 commented on July 18, 2024

@DanAlbert well, we can distribute sources, in the case where the module interface unit and the module implement unit are in the same file. But we can also split them into different files. For example:

module interface unit foo.ixx:

export module foo;

export void test();
export struct Bar {
    Bar();
};

module implement unit foo.cxx:

module foo;
void test() {}
Bar::Bar() {}

then when we compile libfoo.so, we can only distribute foo.ixx, and when we place it into the include directory, prefab can distribute it. So actually we don't need to do extra support to support it. However, we can also scan public CXX_MODULES FILE_SET to identify which files are module interface units and need to be distributed.

from prefab.

DanAlbert avatar DanAlbert commented on July 18, 2024

Ah, that was the missing piece. Thanks!

I guess the next bit of confusion is why the work you did in #181 (automatically filtering includes by extension to determine whether it's a module interface or a regular header) isn't something built in to CMake.

from prefab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.