Provide onecore compliance#2794
Conversation
Update my fork with newest changes
…ovide_onecore_compliance
| set(CMAKE_CXX_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE) | ||
| add_link_options("/LIBPATH:\"\$\(VCInstallDir\)lib/onecore\"") | ||
| add_link_options("/LIBPATH:\"\$\(VC_LibraryPath_VC_x86_OneCore\)\"") | ||
| endif() |
There was a problem hiding this comment.
Current OpenVINO binaries are compliant as well. We just need to ignore msvcp140.dll, vcruntime140.dll errors when run apiValidator, is not it? what is different with and without this code?
There was a problem hiding this comment.
In the project I'm participating right now there is an assumption that apiValidator doesn't take any exclusion list. t means that all errors caused by dynamic linking msvcp140 adn vcruntime make the validation failed.
| CMAKE_CXX_FLAGS_MINSIZEREL | ||
| CMAKE_CXX_FLAGS_RELEASE | ||
| CMAKE_CXX_FLAGS_RELWITHDEBINFO) | ||
| string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
There was a problem hiding this comment.
why do we need static runtime for onecore? Where is it written?
There was a problem hiding this comment.
This is workaround to remove msvcp140.dll, vcruntime140.dll from one core compliance validation.
There was a problem hiding this comment.
Does it mean that we should use static runtime only for Windows SDK version older than "X" version, where "X" version has BinaryExclusionlist.xml list for apiValidator? As far as I can see versions older "10.0.20000.0" does not have BinaryExclusionlist.xml, but newer versions have
There was a problem hiding this comment.
BTW, in the current master branch we have apiValidator run as POST_BUILD step for some OpenVINO dlls. But this run takes into account that msvcp140.dll, vcruntime140.dll libraries are exclusions even for 10.0.1XYZW.0 versions
| if(MSVC_ONE_CORE_COMPLIANCE) | ||
| message([STATUS] "Building OneCore Compliant Binaries") | ||
| if(DEFINED ENV{varBuildWdkVer}) | ||
| # For QB or manual setting - QB sets varBuildWdkVer before build |
There was a problem hiding this comment.
CI Software - in fact the approach can be used locally as well.
| @@ -0,0 +1,36 @@ | |||
| #has to be set before project | |||
| if(MSVC_ONE_CORE_COMPLIANCE) | |||
There was a problem hiding this comment.
can we move content of this script to cmake/onecoreuap.toolchain.cmake? In this case we can pass -DCMAKE_TOOLCHAIN_FILE=cmake/onecoreuap.toolchain.cmake and don't need MSVC_ONE_CORE_COMPLIANCE variable, don't need to set with force CMAKE_C_STANDARD_LIBRARIES and CMAKE_CXX_STANDARD_LIBRARIES
There was a problem hiding this comment.
very likely - yes. I need to check side effects
| set(CMAKE_C_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE) | ||
| set(CMAKE_CXX_STANDARD_LIBRARIES "\$\(UCRTContentRoot\)lib/\$\(TargetUniversalCRTVersion\)/um/x86/OneCoreUap.lib" CACHE STRING "" FORCE) | ||
| add_link_options("/LIBPATH:\"\$\(VCInstallDir\)lib/onecore\"") | ||
| add_link_options("/LIBPATH:\"\$\(VC_LibraryPath_VC_x86_OneCore\)\"") |
There was a problem hiding this comment.
do we need the same for cmake/uwp.toolchain.cmake?
There was a problem hiding this comment.
It would be very good, if you create a new onecoreuap.toochain.cmake with proposed changes and update existing uwp.toolchain.cmake as well.
Thanks for your effort.
No description provided.