mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-23 18:45:36 +00:00
reuse part3
This commit is contained in:
parent
4ebd1641a5
commit
97ccf989aa
@ -19,6 +19,10 @@ struct NidFuncTable {
|
|||||||
int m_version_minor;
|
int m_version_minor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr std::string_view SpdxHeader = R"(// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
)";
|
||||||
|
|
||||||
void GenerateCodeFiles(
|
void GenerateCodeFiles(
|
||||||
const std::unordered_map<std::string, std::vector<NidFuncTable>>& libName2FuncTableMap,
|
const std::unordered_map<std::string, std::vector<NidFuncTable>>& libName2FuncTableMap,
|
||||||
const std::string& moduleName) {
|
const std::string& moduleName) {
|
||||||
@ -26,9 +30,9 @@ void GenerateCodeFiles(
|
|||||||
std::string lowModName = moduleName;
|
std::string lowModName = moduleName;
|
||||||
std::transform(lowModName.begin(), lowModName.end(), lowModName.begin(), ::tolower);
|
std::transform(lowModName.begin(), lowModName.end(), lowModName.begin(), ::tolower);
|
||||||
std::string headerName(lowModName + ".h");
|
std::string headerName(lowModName + ".h");
|
||||||
std::string headerCode("// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project\n// "
|
std::string spdx{SpdxHeader};
|
||||||
"SPDX-License-Identifier: GPL-2.0-or-later");
|
std::string headerCode(spdx);
|
||||||
headerCode += "\n\n";
|
headerCode += "\n";
|
||||||
headerCode += "#pragma once\n\n#include \"library_common.h\" \n\n";
|
headerCode += "#pragma once\n\n#include \"library_common.h\" \n\n";
|
||||||
std::string trimmedName = moduleName;
|
std::string trimmedName = moduleName;
|
||||||
if (moduleName.find("libSce") != std::string::npos) {
|
if (moduleName.find("libSce") != std::string::npos) {
|
||||||
@ -57,9 +61,8 @@ void GenerateCodeFiles(
|
|||||||
headerFile.close();
|
headerFile.close();
|
||||||
|
|
||||||
std::string sourceName(lowModName + ".cpp");
|
std::string sourceName(lowModName + ".cpp");
|
||||||
std::string sourceCode("// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project\n// "
|
std::string sourceCode(spdx);
|
||||||
"SPDX-License-Identifier: GPL-2.0-or-later");
|
sourceCode += "\n";
|
||||||
sourceCode += "\n\n";
|
|
||||||
sourceCode += "// Generated By moduleGenerator\n#include \"" + headerName +
|
sourceCode += "// Generated By moduleGenerator\n#include \"" + headerName +
|
||||||
"\"\n#include \"common/log.h\"\n#include \"error_codes.h\"\n\n";
|
"\"\n#include \"common/log.h\"\n#include \"error_codes.h\"\n\n";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user