mirror of
https://github.com/reactos/CMake.git
synced 2024-12-02 08:37:09 +00:00
Makefile: Allow adding post-build rules to object libraries
This commit is contained in:
parent
96b6afdc42
commit
33a1d727d5
@ -489,7 +489,8 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
|
||||
std::vector<std::string> no_byproducts;
|
||||
lg->GetMakefile()->AddCustomCommandToTarget(
|
||||
target->GetName(), no_byproducts, no_depends, commandLines,
|
||||
cmTarget::POST_BUILD, "Depend check for xcode", dir.c_str());
|
||||
cmTarget::POST_BUILD, "Depend check for xcode", dir.c_str(), true,
|
||||
false, "", false, cmMakefile::AcceptObjectLibraryCommands);
|
||||
}
|
||||
|
||||
if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
|
||||
|
@ -684,7 +684,8 @@ void cmMakefile::AddCustomCommandToTarget(
|
||||
const std::vector<std::string>& depends,
|
||||
const cmCustomCommandLines& commandLines, cmTarget::CustomCommandType type,
|
||||
const char* comment, const char* workingDir, bool escapeOldStyle,
|
||||
bool uses_terminal, const std::string& depfile, bool command_expand_lists)
|
||||
bool uses_terminal, const std::string& depfile, bool command_expand_lists,
|
||||
ObjectLibraryCommands objLibraryCommands)
|
||||
{
|
||||
// Find the target to which to add the custom command.
|
||||
cmTargets::iterator ti = this->Targets.find(target);
|
||||
@ -724,7 +725,8 @@ void cmMakefile::AddCustomCommandToTarget(
|
||||
return;
|
||||
}
|
||||
|
||||
if (ti->second.GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
||||
if (objLibraryCommands == RejectObjectLibraryCommands &&
|
||||
ti->second.GetType() == cmStateEnums::OBJECT_LIBRARY) {
|
||||
std::ostringstream e;
|
||||
e << "Target \"" << target
|
||||
<< "\" is an OBJECT library "
|
||||
|
@ -119,6 +119,13 @@ public:
|
||||
*/
|
||||
void FinalPass();
|
||||
|
||||
/** How to handle custom commands for object libraries */
|
||||
enum ObjectLibraryCommands
|
||||
{
|
||||
RejectObjectLibraryCommands,
|
||||
AcceptObjectLibraryCommands
|
||||
};
|
||||
|
||||
/** Add a custom command to the build. */
|
||||
void AddCustomCommandToTarget(
|
||||
const std::string& target, const std::vector<std::string>& byproducts,
|
||||
@ -126,7 +133,8 @@ public:
|
||||
const cmCustomCommandLines& commandLines, cmTarget::CustomCommandType type,
|
||||
const char* comment, const char* workingDir, bool escapeOldStyle = true,
|
||||
bool uses_terminal = false, const std::string& depfile = "",
|
||||
bool command_expand_lists = false);
|
||||
bool command_expand_lists = false,
|
||||
ObjectLibraryCommands objLibraryCommands = RejectObjectLibraryCommands);
|
||||
cmSourceFile* AddCustomCommandToOutput(
|
||||
const std::vector<std::string>& outputs,
|
||||
const std::vector<std::string>& byproducts,
|
||||
|
Loading…
Reference in New Issue
Block a user