Skip to content

Commit

Permalink
libwebsockets: windows sdk test - do not merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jcar87 committed May 31, 2023
1 parent 6c673eb commit f0a8cc0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 10 additions & 3 deletions recipes/libwebsockets/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,13 @@ def requirements(self):
elif self.options.with_ssl == "wolfssl":
self.requires("wolfssl/4.8.1")

def export_sources(self):
copy(self, "windows_sdk.cmake", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))

def validate(self):
if not is_msvc(self):
raise ConanInvalidConfiguration("DO NOT MERGE - testing something on windows only")

if self.options.shared and self.settings.compiler == "gcc" and Version(self.settings.compiler.version) < "5":
# https://github.com/conan-io/conan-center-index/pull/5321#issuecomment-826367276
raise ConanInvalidConfiguration("{}/{} shared=True with gcc<5 does not build. Please submit a PR with a fix.".format(self.name, self.version))
Expand Down Expand Up @@ -284,6 +290,7 @@ def _find_libraries(self, dep):

def generate(self):
tc = CMakeToolchain(self)
tc.cache_variables["CMAKE_PROJECT_libwebsockets_INCLUDE"] = os.path.join(self.source_folder, "windows_sdk.cmake")
tc.variables["LWS_WITHOUT_TESTAPPS"] = True
tc.variables["LWS_WITHOUT_TEST_SERVER"] = True
tc.variables["LWS_WITHOUT_TEST_SERVER_EXTPOLL"] = True
Expand Down Expand Up @@ -420,9 +427,9 @@ def generate(self):
tc.variables["LWS_WITH_SYS_SMD"] = self.settings.os != "Windows"
tc.variables["DISABLE_WERROR"] = True

if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler.version) == 16) or \
(str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) == 192):
tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0.20348"
# if (str(self.settings.compiler) == "Visual Studio" and Version(self.settings.compiler.version) == 16) or \
# (str(self.settings.compiler) == "msvc" and Version(self.settings.compiler.version) == 192):
# tc.variables["CMAKE_SYSTEM_VERSION"] = "10.0.20348"

tc.generate()
deps = CMakeDeps(self)
Expand Down
2 changes: 2 additions & 0 deletions recipes/libwebsockets/all/windows_sdk.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
message("CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}")
message("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")

0 comments on commit f0a8cc0

Please sign in to comment.