diff --git a/inflection/CMakeLists.txt b/inflection/CMakeLists.txt index 7a045b7f..e6e14c0e 100644 --- a/inflection/CMakeLists.txt +++ b/inflection/CMakeLists.txt @@ -88,9 +88,7 @@ file(MAKE_DIRECTORY ${INFLECTION_INCLUDE_ROOT}) include(dependICU) -add_library(xml2 INTERFACE IMPORTED GLOBAL) -set_target_properties(xml2 PROPERTIES IMPORTED_LIBNAME xml2) -target_include_directories(xml2 INTERFACE ${CMAKE_OSX_SYSROOT}/usr/include/libxml2) +find_package(LibXml2 REQUIRED) # Runs Unicode Inflection unit tests: "make check" set(DYLD_LIBRARY_PATH ${ICU_LIB_DIRECTORY}:$) diff --git a/inflection/src/inflection/dialog/DictionaryLookupFunction.cpp b/inflection/src/inflection/dialog/DictionaryLookupFunction.cpp index 249a374c..e504edd5 100644 --- a/inflection/src/inflection/dialog/DictionaryLookupFunction.cpp +++ b/inflection/src/inflection/dialog/DictionaryLookupFunction.cpp @@ -3,7 +3,6 @@ */ #include #include - #include #include #include @@ -11,7 +10,6 @@ #include "inflection/tokenizer/TokenChain.hpp" #include "inflection/tokenizer/Token_Word.hpp" #include "inflection/tokenizer/TokenizerFactory.hpp" - namespace inflection::dialog { DictionaryLookupFunction::DictionaryLookupFunction(const ::inflection::util::ULocale& locale, const ::std::vector<::std::u16string>& tags) diff --git a/inflection/src/inflection/dialog/DisplayValue.cpp b/inflection/src/inflection/dialog/DisplayValue.cpp index 902a3999..1fc8e260 100644 --- a/inflection/src/inflection/dialog/DisplayValue.cpp +++ b/inflection/src/inflection/dialog/DisplayValue.cpp @@ -9,7 +9,10 @@ namespace inflection::dialog { -DisplayValue::DisplayValue(const ::std::u16string& displayString, const ::std::map& constraintMap) +DisplayValue::DisplayValue( + const ::std::u16string& displayString, + const ::std::map& constraintMap +) : super() , displayString(displayString) , constraintMap(constraintMap) @@ -21,11 +24,23 @@ DisplayValue::DisplayValue(const ::std::u16string& value) { } -DisplayValue::DisplayValue(const SpeakableString& value, const SemanticFeature& speakFeature) - : DisplayValue(value.getPrint(), {}) +DisplayValue::DisplayValue( + const SpeakableString& value, + const SemanticFeature& speakFeature +) + : DisplayValue(value, speakFeature, {}) +{ +} + +DisplayValue::DisplayValue( + const SpeakableString& value, + const SemanticFeature& speakFeature, + const ::std::map& constraintMap +) + : DisplayValue(value.getPrint(), constraintMap) { if (!value.speakEqualsPrint()) { - constraintMap.emplace(speakFeature, value.getSpeak()); + this->constraintMap.emplace(speakFeature, value.getSpeak()); } } diff --git a/inflection/src/inflection/dialog/DisplayValue.hpp b/inflection/src/inflection/dialog/DisplayValue.hpp index 861cbf17..ec802cd3 100644 --- a/inflection/src/inflection/dialog/DisplayValue.hpp +++ b/inflection/src/inflection/dialog/DisplayValue.hpp @@ -72,6 +72,13 @@ class INFLECTION_CLASS_API inflection::dialog::DisplayValue * @param speakFeature The speakFeature from the SemanticFeatureModel that represents the SemanticFeature for the speak information for a SpeakableString. */ DisplayValue(const SpeakableString& value, const SemanticFeature& speakFeature); + /** + * Construct a display value with a SpeakableString. + * @param value A SpeakableString + * @param speakFeature The speakFeature from the SemanticFeatureModel that represents the SemanticFeature for the speak information for a SpeakableString. + * @param constraintMap The intitial constraint map. + */ + DisplayValue(const SpeakableString& value, const SemanticFeature& speakFeature, const ::std::map& constraintMap); /** * The destructor */ diff --git a/inflection/src/inflection/dialog/InflectableStringConcept-c.cpp b/inflection/src/inflection/dialog/InflectableStringConcept-c.cpp index 43323716..948ceb85 100644 --- a/inflection/src/inflection/dialog/InflectableStringConcept-c.cpp +++ b/inflection/src/inflection/dialog/InflectableStringConcept-c.cpp @@ -2,14 +2,18 @@ * Copyright 2021-2024 Apple Inc. All rights reserved. */ #include - +#include #include #include #include #include +#include +#include +#include #include #include + INFLECTION_CAPI IDSemanticFeatureConcept* iinf_toSemanticFeatureConcept(IDInflectableStringConcept* thisObject, UErrorCode*) { return (IDSemanticFeatureConcept*)thisObject; @@ -47,6 +51,27 @@ iinf_create(const IDSemanticFeatureModel* model, const IDSpeakableString* value, return nullptr; } +INFLECTION_CAPI IDInflectableStringConcept* +iinf_createWithDefaults(const IDSemanticFeatureModel* model, const IDSpeakableString* value, + const IDDisplayValue_Constraint* defaultConstraints, int32_t defaultConstraintsLen, UErrorCode* status) +{ + if (status != nullptr && U_SUCCESS(*status)) { + try { + auto defaultConstraintsMap(inflection::dialog::SemanticUtils::to_constraintMap(*npc((const inflection::dialog::SemanticFeatureModel*)model), defaultConstraints, defaultConstraintsLen)); + + return (IDInflectableStringConcept*) new ::inflection::dialog::InflectableStringConcept( + (const ::inflection::dialog::SemanticFeatureModel*)model, + *((const ::inflection::dialog::SpeakableString*)value), + defaultConstraintsMap + ); + } + catch (const ::std::exception& e) { + inflection::util::TypeConversionUtils::convert(e, status); + } + } + return nullptr; +} + INFLECTION_CAPI void iinf_destroy(IDInflectableStringConcept* thisObject) { diff --git a/inflection/src/inflection/dialog/InflectableStringConcept.cpp b/inflection/src/inflection/dialog/InflectableStringConcept.cpp index 7aecd088..d8efdaa8 100644 --- a/inflection/src/inflection/dialog/InflectableStringConcept.cpp +++ b/inflection/src/inflection/dialog/InflectableStringConcept.cpp @@ -15,10 +15,23 @@ namespace inflection::dialog { -InflectableStringConcept::InflectableStringConcept(const SemanticFeatureModel* model, const SpeakableString& value) + +InflectableStringConcept::InflectableStringConcept( + const SemanticFeatureModel* model, + const SpeakableString& value +) + : InflectableStringConcept(model, value, {}) +{ +} + +InflectableStringConcept::InflectableStringConcept( + const SemanticFeatureModel* model, + const SpeakableString& value, + const ::std::map& intitialConstraints +) : super(model) , value(value) - , defaultDisplayValue(value, *npc(super::getSpeakFeature())) + , defaultDisplayValue(value, *npc(super::getSpeakFeature()), intitialConstraints) { } @@ -39,11 +52,40 @@ SpeakableString* InflectableStringConcept::getFeatureValue(const SemanticFeature if (constraint != nullptr) { return new SpeakableString(*npc(constraint)); } + const auto displayValueResult = getDisplayValue(true); + if (displayValueResult) { + const auto defaultFeatureFunction = npc(getModel())->getDefaultFeatureFunction(feature); + ::std::unique_ptr computedValue; + ::std::unique_ptr baseValue; + if (defaultFeatureFunction != nullptr) { + computedValue.reset(npc(defaultFeatureFunction)->getFeatureValue(*displayValueResult, constraints)); + baseValue.reset(npc(defaultFeatureFunction)->getFeatureValue(defaultDisplayValue, constraints)); + } + const auto& displayConstraintMap = displayValueResult->getConstraintMap(); + auto displayConstraint = displayConstraintMap.find(feature); + if (displayConstraint != displayConstraintMap.end()) { + auto numberFeature = npc(getModel())->getFeature(u"number"); + if (feature.getName() == u"gender" && baseValue && numberFeature != nullptr && displayConstraintMap.find(*npc(numberFeature)) != displayConstraintMap.end()) { + return baseValue.release(); + } + return new SpeakableString(displayConstraint->second); + } + if (computedValue) { + return computedValue.release(); + } + if (baseValue) { + return baseValue.release(); + } + } + const auto& initialConstraintMap = defaultDisplayValue.getConstraintMap(); + auto initialConstraint = initialConstraintMap.find(feature); + if (initialConstraint != initialConstraintMap.end()) { + return new SpeakableString(initialConstraint->second); + } auto defaultFeatureFunction = npc(getModel())->getDefaultFeatureFunction(feature); if (defaultFeatureFunction != nullptr) { - const auto displayValueResult = getDisplayValue(true); - if (displayValueResult) { - return npc(defaultFeatureFunction)->getFeatureValue(*displayValueResult, constraints); + if (auto fallbackValue = ::std::unique_ptr(npc(defaultFeatureFunction)->getFeatureValue(defaultDisplayValue, constraints))) { + return fallbackValue.release(); } } return nullptr; @@ -63,11 +105,7 @@ ::std::optional InflectableStringConcept::getDisplayValue(bool all { auto defaultDisplayFunction = npc(getModel())->getDefaultDisplayFunction(); if (defaultDisplayFunction != nullptr && !constraints.empty()) { - ::std::map constraintMap; - if (!value.speakEqualsPrint()) { - constraintMap.emplace(*npc(getSpeakFeature()), value.getSpeak()); - } - SemanticFeatureModel_DisplayData displayData({DisplayValue(value.getPrint(), constraintMap)}); + SemanticFeatureModel_DisplayData displayData({defaultDisplayValue}); ::std::unique_ptr returnVal(npc(defaultDisplayFunction)->getDisplayValue(displayData, constraints, allowInflectionGuess)); if (returnVal != nullptr) { return *returnVal; diff --git a/inflection/src/inflection/dialog/InflectableStringConcept.h b/inflection/src/inflection/dialog/InflectableStringConcept.h index 862818b5..8c5538ef 100644 --- a/inflection/src/inflection/dialog/InflectableStringConcept.h +++ b/inflection/src/inflection/dialog/InflectableStringConcept.h @@ -6,7 +6,7 @@ #include #include #include - +#include /** * An object that provides a way to format a word with additional grammatical category values or semantic features of a word for a given language. */ @@ -34,6 +34,19 @@ INFLECTION_CAPI IDInflectableStringConcept* iinf_toInflectableStringConcept(IDSe * This is set to a failure when a failure has occurred during execution. */ INFLECTION_CAPI IDInflectableStringConcept* iinf_create(const IDSemanticFeatureModel* model, const IDSpeakableString* value, UErrorCode* status); +/** + * Constructs a concept given a semantic feature model and a speakable string + * + * @param model - The semantic feature model required to initialize the concept. + * @param value - The speakable string to convert to a concept + * @param defaultConstraints - The initial defaultConstraints to apply to the concept + * @param defaultConstraintsLen - The number of semantic features and values provided + * @param status Must be a valid pointer to an error code value, + * which must not indicate a failure before the function call. + * This is set to a failure when a failure has occurred during execution. + */ +INFLECTION_CAPI IDInflectableStringConcept* iinf_createWithDefaults(const IDSemanticFeatureModel* model, const IDSpeakableString* value, + const IDDisplayValue_Constraint* defaultConstraints, int32_t defaultConstraintsLen, UErrorCode* status); /** * Destructor */ diff --git a/inflection/src/inflection/dialog/InflectableStringConcept.hpp b/inflection/src/inflection/dialog/InflectableStringConcept.hpp index 617b7f63..c21610d4 100644 --- a/inflection/src/inflection/dialog/InflectableStringConcept.hpp +++ b/inflection/src/inflection/dialog/InflectableStringConcept.hpp @@ -69,6 +69,15 @@ class INFLECTION_CLASS_API inflection::dialog::InflectableStringConcept * @param value - The speakable string to convert to a concept */ InflectableStringConcept(const SemanticFeatureModel* model, const SpeakableString& value); + + /** + * Constructs a concept given a semantic feature model and a speakable string + * + * @param model - The semantic feature model required to initialize the concept. + * @param value - The speakable string to convert to a concept + * @param intitialConstraints - The intitial constraints for the map. + */ + InflectableStringConcept(const SemanticFeatureModel* model, const SpeakableString& value, const std::map& intitialConstraints); /** * Copy constructor */ diff --git a/inflection/src/inflection/grammar/synthesis/FrGrammarSynthesizer_CountLookupFunction.cpp b/inflection/src/inflection/grammar/synthesis/FrGrammarSynthesizer_CountLookupFunction.cpp index 3029dff2..9d463aa3 100644 --- a/inflection/src/inflection/grammar/synthesis/FrGrammarSynthesizer_CountLookupFunction.cpp +++ b/inflection/src/inflection/grammar/synthesis/FrGrammarSynthesizer_CountLookupFunction.cpp @@ -67,7 +67,7 @@ ::std::optional<::std::u16string> FrGrammarSynthesizer_CountLookupFunction::dete int64_t wordGrammemes = 0; dictionary.getCombinedBinaryType(&wordGrammemes, word); if ((wordGrammemes & properNounProperty) == properNounProperty) { - return {{}}; + return std::u16string{}; } if (checkInvariantNouns(word, wordGrammemes)) { return GrammemeConstants::NUMBER_SINGULAR(); diff --git a/inflection/src/inflection/grammar/synthesis/HiGrammarSynthesizer_HiDisplayFunction.cpp b/inflection/src/inflection/grammar/synthesis/HiGrammarSynthesizer_HiDisplayFunction.cpp index ae32c6a9..938110df 100644 --- a/inflection/src/inflection/grammar/synthesis/HiGrammarSynthesizer_HiDisplayFunction.cpp +++ b/inflection/src/inflection/grammar/synthesis/HiGrammarSynthesizer_HiDisplayFunction.cpp @@ -185,7 +185,7 @@ ::std::optional<::std::u16string> HiGrammarSynthesizer_HiDisplayFunction::inflec ::std::optional<::std::vector<::std::u16string>> HiGrammarSynthesizer_HiDisplayFunction::inflectSignificantWords(const std::vector<::std::u16string> &words, const ::std::map &constraints, bool enableInflectionGuess) const { if (words.empty()) { - return {{}}; + return std::vector{}; } const auto &dictionary = dictionaryInflector.getDictionary(); int64_t adpositionIndex = -1; diff --git a/inflection/src/inflection/grammar/synthesis/PtGrammarSynthesizer_PtDisplayFunction.cpp b/inflection/src/inflection/grammar/synthesis/PtGrammarSynthesizer_PtDisplayFunction.cpp index 76550d1a..cd4b8376 100644 --- a/inflection/src/inflection/grammar/synthesis/PtGrammarSynthesizer_PtDisplayFunction.cpp +++ b/inflection/src/inflection/grammar/synthesis/PtGrammarSynthesizer_PtDisplayFunction.cpp @@ -195,7 +195,7 @@ ::std::optional<::std::vector<::std::u16string>> PtGrammarSynthesizer_PtDisplayF ::std::optional<::std::vector<::std::u16string>> PtGrammarSynthesizer_PtDisplayFunction::inflectSignificantWords(const std::vector<::std::u16string> &words, const ::std::map<::inflection::dialog::SemanticFeature, ::std::u16string> &constraints, bool enableInflectionGuess) const { switch (words.size()) { - case 0: return {{}}; + case 0: return std::vector{}; case 1: { int64_t wordType = 0; dictionary.getCombinedBinaryType(&wordType, words[0]); diff --git a/inflection/test/CMakeLists.txt b/inflection/test/CMakeLists.txt index 8ffdba40..aa92d315 100644 --- a/inflection/test/CMakeLists.txt +++ b/inflection/test/CMakeLists.txt @@ -8,7 +8,7 @@ target_link_libraries(itest PRIVATE inflection Catch2 - xml2 + LibXml2::LibXml2 marisa_objs ICU::uc ICU::i18n $<$:${PERFDATA_FRAMEWORK}> diff --git a/inflection/test/resources/inflection/dialog/inflection/es.xml b/inflection/test/resources/inflection/dialog/inflection/es.xml index 46d99fea..568cca0e 100644 --- a/inflection/test/resources/inflection/dialog/inflection/es.xml +++ b/inflection/test/resources/inflection/dialog/inflection/es.xml @@ -221,4 +221,11 @@ álgebra añejael álgebra añeja añeja álgebrala añeja álgebra área + + + cometael cometa + cometala cometa + QQQQlos QQQQ + QQQQlas QQQQ + diff --git a/inflection/test/src/inflection/dialog/InflectableStringConceptTest-c.cpp b/inflection/test/src/inflection/dialog/InflectableStringConceptTest-c.cpp index 291f27e7..999407dd 100644 --- a/inflection/test/src/inflection/dialog/InflectableStringConceptTest-c.cpp +++ b/inflection/test/src/inflection/dialog/InflectableStringConceptTest-c.cpp @@ -155,6 +155,73 @@ TEST_CASE("InflectableStringConceptTest-c#testExistsAPISpanish") iinf_destroy(inflectableConcept); } +TEST_CASE("InflectableStringConceptTest-c#testCreateWithDefaults") +{ + auto error = U_ZERO_ERROR; + auto ccfp = ilccfp_getDefaultCommonConceptFactoryProvider(&error); + REQUIRE(U_SUCCESS(error)); + + const auto locale = ::inflection::util::LocaleUtils::SPANISH().getName().c_str(); + auto ccf = ilccfp_getCommonConceptFactory(ccfp, locale, &error); + REQUIRE(U_SUCCESS(error)); + + auto model = iccf_getSemanticFeatureModel(ccf, &error); + REQUIRE(U_SUCCESS(error)); + + const std::u16string source = u"cometa"; + auto sourceString = iss_create(source.c_str(), static_cast(source.size()), &error); + REQUIRE(U_SUCCESS(error)); + + IDDisplayValue_Constraint defaultConstraints[] = { + {u"gender", u"masculine"}, + }; + + auto inflectableConcept = iinf_createWithDefaults(model, + sourceString, + defaultConstraints, + static_cast(sizeof(defaultConstraints) / sizeof(defaultConstraints[0])), + &error); + iss_destroy(sourceString); + REQUIRE(U_SUCCESS(error)); + REQUIRE(inflectableConcept != nullptr); + + auto semanticConcept = iinf_toSemanticFeatureConcept(inflectableConcept, &error); + REQUIRE(U_SUCCESS(error)); + + isfc_putConstraintByName(semanticConcept, u"definiteness", u"definite", -1, &error); + REQUIRE(U_SUCCESS(error)); + + auto printedValue = isfc_toSpeakableStringCopy(semanticConcept, &error); + REQUIRE(U_SUCCESS(error)); + util::StringContainer printedContainer(printedValue); + REQUIRE(printedContainer); + CHECK(printedContainer.value == u"el cometa"); + iss_destroy(printedValue); + + auto genderValue = isfc_createFeatureValueByNameCopy(semanticConcept, u"gender", &error); + REQUIRE(U_SUCCESS(error)); + util::StringContainer genderContainer(genderValue); + REQUIRE(genderContainer); + CHECK(genderContainer.value == u"masculine"); + iss_destroy(genderValue); + + auto numberValue = isfc_createFeatureValueByNameCopy(semanticConcept, u"number", &error); + REQUIRE(U_SUCCESS(error)); + util::StringContainer numberContainer(numberValue); + REQUIRE(numberContainer); + CHECK(numberContainer.value == u"singular"); + iss_destroy(numberValue); + + auto definitenessValue = isfc_createFeatureValueByNameCopy(semanticConcept, u"definiteness", &error); + REQUIRE(U_SUCCESS(error)); + util::StringContainer definitenessContainer(definitenessValue); + REQUIRE(definitenessContainer); + CHECK(definitenessContainer.value == u"definite"); + iss_destroy(definitenessValue); + + iinf_destroy(inflectableConcept); +} + TEST_CASE("InflectableStringConceptTest-c#testSpanish") { auto error = U_ZERO_ERROR; diff --git a/inflection/test/src/inflection/dialog/InflectionTest.cpp b/inflection/test/src/inflection/dialog/InflectionTest.cpp index d6db7e8b..81444110 100644 --- a/inflection/test/src/inflection/dialog/InflectionTest.cpp +++ b/inflection/test/src/inflection/dialog/InflectionTest.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -35,9 +36,26 @@ static std::string getInfoStringForTestInput(const ::inflection::dialog::Semanti return "locale=" + model.getLocale().getName() + (source.isEmpty() ? "" : std::string(" source=") + inflection::util::StringUtils::to_string(source.toString())) + " {" + constraintsStr + "}"; } -static void compareInflection(const ::inflection::dialog::SemanticFeatureModel& model, const ::inflection::dialog::SpeakableString& expected, const ::inflection::dialog::SpeakableString& source, const std::map& constraints, const std::map& resultAttributes) +static void compareInflection(const ::inflection::dialog::SemanticFeatureModel& model, + const ::inflection::dialog::SpeakableString& expected, + const ::inflection::dialog::SpeakableString& source, + const std::map& constraints, + const std::map& resultAttributes, + const std::map& initialAttributes) { - inflection::dialog::InflectableStringConcept inflectableConcept(&model, source); + std::map intitialConstraints; + for(const auto& [attrKey, attrVal] : initialAttributes) { + auto featureName = model.getFeature(attrKey); + if (featureName == nullptr) { + FAIL_CHECK(model.getLocale().getName() + std::string(": feature name is not recognized: ") + inflection::util::StringUtils::to_string(attrKey)); + } + const auto& boundedValues(npc(featureName)->getBoundedValues()); + if (!boundedValues.empty() && boundedValues.find(attrVal) == boundedValues.end()) { + FAIL_CHECK(model.getLocale().getName() + std::string(": feature value \"") + inflection::util::StringUtils::to_string(attrVal) + "\" is not valid for feature \"" + inflection::util::StringUtils::to_string(attrKey) + "\""); + } + intitialConstraints[*featureName] = attrVal; + } + inflection::dialog::InflectableStringConcept inflectableConcept(&model, source, intitialConstraints); for (const auto& constraint : constraints) { auto featureName = model.getFeature(constraint.first); if (featureName == nullptr) { @@ -171,16 +189,26 @@ TEST_CASE("InflectionTest#testInflections") if (xmlStrEqual(sourceNode->name, (const xmlChar *) "source") == 0) { throw ::inflection::exception::XMLParseException(u"Expecting element , got <" + ::inflection::util::StringUtils::to_u16string(std::string(reinterpret_cast(sourceNode->name))) + u">"); } - xmlNodePtr resultNode = xmlNextElementSibling(sourceNode); - if (xmlStrEqual(resultNode->name, (const xmlChar *) "result") == 0) { - throw ::inflection::exception::XMLParseException(u"Expecting element , got <" + ::inflection::util::StringUtils::to_u16string(std::string(reinterpret_cast(resultNode->name))) + u">"); + + // optional initial child tag + curTestChild = xmlNextElementSibling(sourceNode); + xmlNodePtr initialNode = nullptr; + if(xmlStrEqual(curTestChild->name, (const xmlChar*) "initial") != 0) { + initialNode = curTestChild; + curTestChild = xmlNextElementSibling(curTestChild); + } + + if (xmlStrEqual(curTestChild->name, (const xmlChar *) "result") == 0) { + throw ::inflection::exception::XMLParseException(u"Expecting element , got <" + ::inflection::util::StringUtils::to_u16string(std::string(reinterpret_cast(curTestChild->name))) + u">"); } + xmlNodePtr resultNode = curTestChild; auto sourceConstraints(XMLUtils::getAttributes(sourceNode)); auto resultAttributes(XMLUtils::getAttributes(resultNode)); + auto initialAttributes(XMLUtils::getAttributes(initialNode)); auto sourceString(getSpeakableString(sourceNode)); auto resultString(getSpeakableString(resultNode)); - compareInflection(*npc(model), resultString, sourceString, sourceConstraints, resultAttributes); + compareInflection(*npc(model), resultString, sourceString, sourceConstraints, resultAttributes, initialAttributes); numTests++; } xmlFreeDoc(xmlDoc); diff --git a/inflection/test/src/util/XMLUtils.cpp b/inflection/test/src/util/XMLUtils.cpp index 1a6d79cb..bbe4e201 100644 --- a/inflection/test/src/util/XMLUtils.cpp +++ b/inflection/test/src/util/XMLUtils.cpp @@ -11,6 +11,7 @@ #include std::map XMLUtils::getAttributes(xmlNodePtr node) { + if(node == nullptr) return { }; xmlAttr* attribute = node->properties; std::map result; while (attribute) { diff --git a/inflection/tools/CMakeLists.txt b/inflection/tools/CMakeLists.txt index 47f8f34c..764b990e 100644 --- a/inflection/tools/CMakeLists.txt +++ b/inflection/tools/CMakeLists.txt @@ -11,7 +11,7 @@ endif() set(CMAKE_CXX_FLAGS_${BUILD_TYPE} ${CMAKE_CXX_FLAGS_RELEASE}) target_link_libraries(tool_libraries INTERFACE - xml2 + LibXml2::LibXml2 ICU::uc ICU::i18n $<$:${CMAKE_DL_LIBS}> ) diff --git a/inflection/tools/xml2cpp/CMakeLists.txt b/inflection/tools/xml2cpp/CMakeLists.txt index 869136f1..06b1bf5d 100644 --- a/inflection/tools/xml2cpp/CMakeLists.txt +++ b/inflection/tools/xml2cpp/CMakeLists.txt @@ -3,5 +3,5 @@ # file(GLOB_RECURSE XML2CPP_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) add_executable(xml2cpp ${XML2CPP_SOURCES}) -target_link_libraries(xml2cpp xml2) +target_link_libraries(xml2cpp LibXml2::LibXml2) add_dependencies(tools xml2cpp) \ No newline at end of file