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