-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libsodium: fix several regressions of #13792 #14998
Conversation
I detected other pull requests that are modifying libsodium/all recipe: This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
eb2e817
to
5063b7d
Compare
This comment has been minimized.
This comment has been minimized.
5063b7d
to
69cba0e
Compare
Conan v1 pipelineAll green in build 8 (
Conan v2 pipeline (informative, not required for merge)All green in build 8 ( |
# FIXME: There is currently no guarantee from new MSBuild helper that props files | ||
# generated by MSBuildToolchain and MSBuildDeps have precedence over custom values of project. | ||
# Therefore conantoolchain.props is injected manually before Microsoft.Cpp.Default.props like it was done | ||
# with /p:ForceImportBeforeCppTargets in legacy MSBuild helper. | ||
# see: | ||
# - https://learn.microsoft.com/en-us/cpp/build/modify-project-properties-without-changing-project-file | ||
# - https://github.com/conan-io/conan/issues/12155 | ||
conantoolchain_props = os.path.join(self.generators_folder, "conantoolchain.props") | ||
replace_in_file( | ||
self, | ||
vcxproj_file, | ||
f"<PlatformToolset>{old_toolset}</PlatformToolset>", | ||
f"<PlatformToolset>{platform_toolset}</PlatformToolset>", | ||
self, vcxproj_path, | ||
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />", | ||
f"<Import Project=\"{conantoolchain_props}\" />\n<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />", | ||
) | ||
|
||
def _build_msvc(self): | ||
msvc_ver_subfolder = self._msvc_sln_folder or ("vs2022" if self.version != "1.0.18" else "vs2019") | ||
msvc_sln_folder = os.path.join(self.build_folder, self.source_folder, "builds", "msvc", msvc_ver_subfolder) | ||
|
||
msvc_sln_path = os.path.join(msvc_sln_folder, "libsodium.sln") | ||
|
||
# 1.0.18 only supported up to vs2019. Add support for newer toolsets. | ||
if self.version == "1.0.18" and msvc_ver_subfolder == "vs2019": | ||
vcxproj_path = os.path.join(msvc_sln_folder, "libsodium", "libsodium.vcxproj") | ||
self._fix_msvc_platform_toolset(vcxproj_path, "v142") | ||
# Honor runtime library from profile | ||
runtime_library = MSBuildToolchain(self).runtime_library | ||
for prop_file, runtime_library_old in [ | ||
("DebugDEXE.props", "MultiThreadedDebugDLL"), | ||
("DebugDLL.props", "MultiThreadedDebugDLL"), | ||
("DebugLEXE.props", "MultiThreadedDebug"), | ||
("DebugLIB.props", "MultiThreadedDebug"), | ||
("DebugLTCG.props", "MultiThreadedDebug"), | ||
("DebugSEXE.props", "MultiThreadedDebug"), | ||
("ReleaseDEXE.props", "MultiThreadedDLL"), | ||
("ReleaseDLL.props", "MultiThreadedDLL"), | ||
("ReleaseLEXE.props", "MultiThreaded"), | ||
("ReleaseLIB.props", "MultiThreaded"), | ||
("ReleaseLTCG.props", "MultiThreaded"), | ||
("ReleaseSEXE.props", "MultiThreaded"), | ||
]: | ||
replace_in_file( | ||
self, os.path.join(msvc_builds_folder, "properties", prop_file), | ||
f"<RuntimeLibrary>{runtime_library_old}</RuntimeLibrary>", | ||
f"<RuntimeLibrary>{runtime_library}</RuntimeLibrary>", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened conan-io/conan#12817, I think it will avoid all this mess (which was unecessary with legacy MSBuild
helper).
* rely on similar CMakeLists in test v1 package & test package * modernize more * simplify msvc build logic * properly inject props files generated by MSBuildToolchain * relocatable shared lib on macOS * restore autoreconf call if mingw * honor runtime from profile
Fix several regressions coming from #13792:
@rpath
in install_name of shared libMoreover, I've simplified unecessary complex things in msvc build branch (like
_fix_msvc_platform_toolset
, unecessary calls to MSBuildDeps or VCVars generators etc).