From c2f2d21b215493ed2443a9f8650327e7fba00005 Mon Sep 17 00:00:00 2001 From: Ken Frederickson Date: Thu, 9 Sep 2021 11:49:23 -0600 Subject: [PATCH 1/2] workaround for qmake generator bug which causes failure to build QWT dll --- recipes/qwt/all/conanfile.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index 9c52d58b09eba..d360e6166f7db 100644 --- a/recipes/qwt/all/conanfile.py +++ b/recipes/qwt/all/conanfile.py @@ -87,8 +87,15 @@ def _patch_qwt_config_files(self): qwtbuild += "CONFIG += force_debug_info\n" tools.save(qwtbuild_path, qwtbuild) + def _patch_qmake_generator_files(self): + # Work around the qmake generator bug (https://github.com/conan-io/conan/pull/9568) which + # causes exe linker flags to be set on DLL, causing link failure. + if self.settings.compiler == "Visual Studio" and self.options.shared == True: + tools.replace_in_file(os.path.join(self.build_folder, "conanbuildinfo.pri"), "CONAN_QMAKE_LFLAGS += -ENTRY:mainCRTStartup", "") + def build(self): self._patch_qwt_config_files() + self._patch_qmake_generator_files() if self.settings.compiler == "Visual Studio": vcvars = tools.vcvars_command(self.settings) From 2117293a4bb849d6201178817eed291f0fb7958e Mon Sep 17 00:00:00 2001 From: kenfred Date: Thu, 9 Sep 2021 15:48:11 -0600 Subject: [PATCH 2/2] Update recipes/qwt/all/conanfile.py Co-authored-by: ericLemanissier --- recipes/qwt/all/conanfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/qwt/all/conanfile.py b/recipes/qwt/all/conanfile.py index d360e6166f7db..1f9f8cceab81e 100644 --- a/recipes/qwt/all/conanfile.py +++ b/recipes/qwt/all/conanfile.py @@ -90,8 +90,8 @@ def _patch_qwt_config_files(self): def _patch_qmake_generator_files(self): # Work around the qmake generator bug (https://github.com/conan-io/conan/pull/9568) which # causes exe linker flags to be set on DLL, causing link failure. - if self.settings.compiler == "Visual Studio" and self.options.shared == True: - tools.replace_in_file(os.path.join(self.build_folder, "conanbuildinfo.pri"), "CONAN_QMAKE_LFLAGS += -ENTRY:mainCRTStartup", "") + if self.settings.compiler == "Visual Studio": + tools.replace_in_file(os.path.join(self.build_folder, "conanbuildinfo.pri"), "CONAN_QMAKE_LFLAGS += -ENTRY:mainCRTStartup", "", strict=False) def build(self): self._patch_qwt_config_files()