cppmake 30__tar.gz → 32__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: 32
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,47 @@
1
+ from cppmakelib import *
2
+
3
+ def main():
4
+ if not exist_dir("package/std"): # install std as default
5
+ create_dir("package/std/module")
6
+ open ("package/std/module/std.cpp", 'w').write(default_std_module)
7
+ open ("package/std/cppmake.py", 'w').write(default_std_cppmake)
8
+ Package("std").build()
9
+
10
+ if Package("main").cppmake is not None:
11
+ getattr(Package("main").cppmake, config.target)()
12
+ else: # compile Source("main") as default
13
+ Source("main").compile()
14
+
15
+
16
+
17
+
18
+ default_std_module = \
19
+ """
20
+ module;
21
+ #include <include>
22
+
23
+ export module std;
24
+ #include <export>
25
+ """
26
+
27
+ default_std_cppmake = \
28
+ """
29
+ from cppmakelib import *
30
+
31
+ if type(compiler) == Clang or type(compiler) == Emcc:
32
+ package.compile_flags += [
33
+ "-Wno-include-angled-in-module-purview",
34
+ "-Wno-reserved-module-identifier"
35
+ ]
36
+
37
+ def build():
38
+ std_module = compiler.std_module()
39
+ create_dir(package.include_dir)
40
+ copy_dir(parent_path(std_module), package.include_dir)
41
+ with open(std_module, 'r') as reader:
42
+ content = reader.read().split("export module std;")
43
+ with open(f"{package.include_dir}/include", 'w') as writer:
44
+ writer.write(content[0].replace("module;", ""))
45
+ with open(f"{package.include_dir}/export", 'w') as writer:
46
+ writer.write(content[1])
47
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cppmake
3
- Version: 30
3
+ Version: 32
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 = "32"
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