cppmake 30__tar.gz → 31__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cppmake
3
- Version: 30
3
+ Version: 31
4
4
  Summary: A modern C++ builder based on C++20 Modules.
5
5
  Author-email: anonymouspc <shyeyian@petalmail.com>
6
6
  License-Expression: MIT
@@ -0,0 +1,45 @@
1
+ from cppmakelib import *
2
+
3
+ def main():
4
+ if not exist_dir("package/std"):
5
+ create_dir("package/std/module")
6
+ open("package/std/cppmake.py", 'w').write(default_std_cppmake)
7
+ open("package/std/module/std.cpp", 'w').write(default_std_module)
8
+ Package("std").build()
9
+
10
+ if Package("main").cppmake is not None:
11
+ getattr(Package("main").cppmake, config.target)()
12
+ else: # default
13
+ Source("main").compile()
14
+
15
+
16
+ default_std_cppmake = \
17
+ """
18
+ from cppmakelib import *
19
+
20
+ if type(compiler) == Clang or type(compiler) == Emcc:
21
+ package.compile_flags += [
22
+ "-Wno-include-angled-in-module-purview",
23
+ "-Wno-reserved-module-identifier"
24
+ ]
25
+
26
+ def build():
27
+ std_module = compiler.std_module()
28
+ create_dir(package.include_dir)
29
+ copy_dir(parent_path(std_module), package.include_dir)
30
+ with open(std_module, 'r') as reader:
31
+ content = reader.read().split("export module std;")
32
+ with open(f"{package.include_dir}/include", 'w') as writer:
33
+ writer.write(content[0].replace("module;", ""))
34
+ with open(f"{package.include_dir}/export", 'w') as writer:
35
+ writer.write(content[1])
36
+ """
37
+
38
+ default_std_module = \
39
+ """
40
+ module;
41
+ #include <include>
42
+
43
+ export module std;
44
+ #include <export>
45
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cppmake
3
- Version: 30
3
+ Version: 31
4
4
  Summary: A modern C++ builder based on C++20 Modules.
5
5
  Author-email: anonymouspc <shyeyian@petalmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cppmake"
7
- version = "30"
7
+ version = "31"
8
8
  description = "A modern C++ builder based on C++20 Modules."
9
9
  authors = [{name = "anonymouspc", email = "shyeyian@petalmail.com"}]
10
10
  readme = "readme.md"
@@ -1,7 +0,0 @@
1
- from cppmakelib import *
2
-
3
- def main():
4
- if Package("main").cppmake is not None:
5
- getattr(Package("main").cppmake, config.target)()
6
- else: # default
7
- Source("main").compile()
File without changes
File without changes
File without changes