C++ Module Interface

A console application that uses a single module interface file used inside the same projects.

Source

recipe.sml

The Recipe file that sets the name, type, version, the public interface module and the single source file.

Name: 'Samples.Cpp.ModuleInterface'
Language: 'C++|0'
Type: 'Executable'
Version: 1.0.0

executable/package-lock.sml

The package lock that was generated to capture the unique build dependencies required to build this project.

Version: 5
Closures: {
  Root: {
    'C++': {
      'Samples.Cpp.ModuleInterface': { Version: './', Build: 'Build0', Tool: 'Tool0' }
    }
  }
  Build0: {
    Wren: {
      'Soup|Cpp': { Version: 0.16.0 }
    }
  }
  Tool0: {
    'C++': {
      'mwasplund|copy': { Version: 1.2.0 }
      'mwasplund|mkdir': { Version: 1.2.0 }
      'mwasplund|parse.modules': { Version: 1.2.0 }
    }
  }
}

helper.cpp

A module interface file that exports a single sample class.

module;

// Include all standard library headers in the global module
#include <string>

export module Samples.Cpp.ModuleInterface;

export class Helper
{
public:
  static std::string GetName()
  {
    return "Soup";
  }
};

main.cpp

A simple main method that prints our "Hello World, Soup Style!" by using the module from the previous file.

#include <iostream>

import Samples.Cpp.ModuleInterface;

int main()
{
  std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl;
  return 0;
}

.gitignore

A simple git ignore file to exclude all Soup build output.

out/