mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
some fix
This commit is contained in:
parent
2d0db3dc71
commit
3bd794f2fb
27
include/pocketpy/common/_generated.h
Normal file
27
include/pocketpy/common/_generated.h
Normal file
@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
// generated by prebuild.py
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const char kPythonLibs__enum[];
|
||||
extern const char kPythonLibs__long[];
|
||||
extern const char kPythonLibs__set[];
|
||||
extern const char kPythonLibs_bisect[];
|
||||
extern const char kPythonLibs_builtins[];
|
||||
extern const char kPythonLibs_cmath[];
|
||||
extern const char kPythonLibs_collections[];
|
||||
extern const char kPythonLibs_colorsys[];
|
||||
extern const char kPythonLibs_datetime[];
|
||||
extern const char kPythonLibs_functools[];
|
||||
extern const char kPythonLibs_heapq[];
|
||||
extern const char kPythonLibs_itertools[];
|
||||
extern const char kPythonLibs_operator[];
|
||||
extern const char kPythonLibs_pickle[];
|
||||
extern const char kPythonLibs_this[];
|
||||
extern const char kPythonLibs_typing[];
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
// generated by prebuild.py
|
||||
|
||||
namespace pkpy{
|
||||
extern const char kPythonLibs__enum[];
|
||||
extern const char kPythonLibs__long[];
|
||||
extern const char kPythonLibs__set[];
|
||||
extern const char kPythonLibs_bisect[];
|
||||
extern const char kPythonLibs_builtins[];
|
||||
extern const char kPythonLibs_cmath[];
|
||||
extern const char kPythonLibs_collections[];
|
||||
extern const char kPythonLibs_colorsys[];
|
||||
extern const char kPythonLibs_datetime[];
|
||||
extern const char kPythonLibs_functools[];
|
||||
extern const char kPythonLibs_heapq[];
|
||||
extern const char kPythonLibs_itertools[];
|
||||
extern const char kPythonLibs_operator[];
|
||||
extern const char kPythonLibs_pickle[];
|
||||
extern const char kPythonLibs_this[];
|
||||
extern const char kPythonLibs_typing[];
|
||||
} // namespace pkpy
|
23
prebuild.py
23
prebuild.py
@ -23,26 +23,31 @@ def get_sources():
|
||||
sources = get_sources()
|
||||
|
||||
# use LF line endings instead of CRLF
|
||||
with open("include/pocketpy/common/_generated.hpp", "wt", encoding='utf-8', newline='\n') as f:
|
||||
with open("include/pocketpy/common/_generated.h", "wt", encoding='utf-8', newline='\n') as f:
|
||||
data = '''#pragma once
|
||||
// generated by prebuild.py
|
||||
|
||||
namespace pkpy{
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
'''
|
||||
for key in sorted(sources.keys()):
|
||||
value = sources[key]
|
||||
data += f' extern const char kPythonLibs_{key}[];\n'
|
||||
data += '} // namespace pkpy\n'
|
||||
data += f'extern const char kPythonLibs_{key}[];\n'
|
||||
data += '''
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
'''
|
||||
f.write(data)
|
||||
|
||||
with open("src/common/_generated.cpp", "wt", encoding='utf-8', newline='\n') as f:
|
||||
with open("src/common/_generated.c", "wt", encoding='utf-8', newline='\n') as f:
|
||||
data = '''// generated by prebuild.py
|
||||
#include "pocketpy/common/_generated.hpp"
|
||||
#include "pocketpy/common/_generated.h"
|
||||
|
||||
namespace pkpy{
|
||||
'''
|
||||
for key in sorted(sources.keys()):
|
||||
value = sources[key]
|
||||
data += f' const char kPythonLibs_{key}[] = {value};\n'
|
||||
data += '} // namespace pkpy\n'
|
||||
data += f'const char kPythonLibs_{key}[] = {value};\n'
|
||||
f.write(data)
|
||||
|
19
src/common/_generated.c
Normal file
19
src/common/_generated.c
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@
|
||||
#include "pocketpy/common/version.h"
|
||||
#include "pocketpy/common/export.h"
|
||||
|
||||
#include "pocketpy/common/_generated.hpp"
|
||||
#include "pocketpy/common/_generated.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "pocketpy/pocketpy.hpp"
|
||||
|
||||
#include "pocketpy/common/_generated.hpp"
|
||||
#include "pocketpy/common/_generated.h"
|
||||
|
||||
#include "pocketpy/modules/array2d.hpp"
|
||||
#include "pocketpy/modules/base64.hpp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user