Skip to content

Commit

Permalink
removed ADDON_PREPROCESSOR_DEFINES and use ADDON_DEFINES instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian committed Aug 29, 2019
1 parent b1ef172 commit 3ff92b5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
2 changes: 1 addition & 1 deletion ofxProjectGenerator/src/addons/ofAddon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ bool ofAddon::checkCorrectVariable(string variable, ConfigParseState state){
variable == "ADDON_DATA" ||
variable == "ADDON_LIBS_EXCLUDE" || variable == "ADDON_SOURCES_EXCLUDE" || variable == "ADDON_INCLUDES_EXCLUDE" ||
variable == "ADDON_DLLS_TO_COPY" ||
variable == "ADDON_DEFINES" || variable == "ADDON_PREPROCESSOR_DEFINITIONS");
variable == "ADDON_DEFINES");
case Unknown:
default:
return false;
Expand Down
30 changes: 0 additions & 30 deletions ofxProjectGenerator/src/projects/visualStudioProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,31 +367,6 @@ void visualStudioProject::addDefine(std::string define, LibType libType)
{
pugi::xpath_node_set items = doc.select_nodes("//ItemDefinitionGroup");
for (int i = 0; i<items.size(); i++) {
pugi::xml_node additionalOptions;
bool found = false;
std::string condition(items[i].node().attribute("Condition").value());
if (libType == RELEASE_LIB && condition.find("Debug") != std::string::npos) {
additionalOptions = items[i].node().child("ClCompile").child("AdditionalOptions");
found = true;
}
else if (libType == DEBUG_LIB && condition.find("Release") != std::string::npos) {
additionalOptions = items[i].node().child("ClCompile").child("AdditionalOptions");
found = true;
}
if (!found) continue;
if (!additionalOptions) {
items[i].node().child("ClCompile").append_child("PreprocessorDefinitions").append_child(pugi::node_pcdata).set_value(define.c_str());
}
else {
additionalOptions.first_child().set_value((std::string(additionalOptions.first_child().value()) + " " + define).c_str());
}
}
}

void visualStudioProject::addPreprocessorDefinitions(std::string define, LibType libType)
{
pugi::xpath_node_set items = doc.select_nodes("//ItemDefinitionGroup");
for (int i = 0; i < items.size(); i++) {
pugi::xml_node additionalOptions;
bool found = false;
std::string condition(items[i].node().attribute("Condition").value());
Expand Down Expand Up @@ -491,9 +466,4 @@ void visualStudioProject::addAddon(ofAddon & addon){
addDefine(addon.defines[i], DEBUG_LIB);
}

for (int i = 0; i < (int)addon.preprocessorDefinitions.size(); i++) {
ofLogVerbose() << "adding addon preprocessorDefinitions: " << addon.preprocessorDefinitions[i];
addPreprocessorDefinitions(addon.preprocessorDefinitions[i], RELEASE_LIB);
addPreprocessorDefinitions(addon.preprocessorDefinitions[i], DEBUG_LIB);
}
}
1 change: 0 additions & 1 deletion ofxProjectGenerator/src/projects/visualStudioProject.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class visualStudioProject : public baseProject {
void addCFLAG(std::string cflag, LibType libType = RELEASE_LIB); // C
void addCPPFLAG(std::string cppflag, LibType libType = RELEASE_LIB); // C++
void addDefine(std::string define, LibType libType = RELEASE_LIB);
void addPreprocessorDefinitions(std::string define, LibType libType = RELEASE_LIB);

void addAddon(ofAddon & addon);

Expand Down

0 comments on commit 3ff92b5

Please sign in to comment.