diff --git a/conan/tools/cmake/toolchain.py b/conan/tools/cmake/toolchain.py index 3caf3e647bf..07bec1ee933 100644 --- a/conan/tools/cmake/toolchain.py +++ b/conan/tools/cmake/toolchain.py @@ -145,7 +145,7 @@ def context(self): if fpic is None: return None os_ = self._conanfile.settings.get_safe("os") - if os_ and "Windows" in os_: + if os_ == "Windows": self._conanfile.output.warn("Toolchain: Ignoring fPIC option defined for Windows") return None shared = self._conanfile.options.get_safe("shared")