@@ -31,7 +31,7 @@ class PistacheConan(ConanFile):
31
31
"shared" : False ,
32
32
"fPIC" : True ,
33
33
"with_ssl" : False ,
34
- "with_libevent" : True
34
+ "with_libevent" : False
35
35
}
36
36
implements = ["auto_shared_fpic" ]
37
37
@@ -56,15 +56,16 @@ def requirements(self):
56
56
self .requires ("date/3.0.1" )
57
57
if self .options .with_ssl :
58
58
self .requires ("openssl/[>=1.1 <4]" )
59
- if self .options .get_safe ("with_libevent" , True ):
59
+ if self .settings .os != "Linux" or self .options .get_safe ("with_libevent" ):
60
+ # INFO: meson.build:188: Linux can use native epoll support. Other OS need libevent always
60
61
self .requires ("libevent/2.1.12" )
61
62
62
63
def validate (self ):
63
64
if self .settings .os != "Linux" and Version (self .version ) < "0.4.25" :
64
65
raise ConanInvalidConfiguration (f"{ self .ref } is only support on Linux." )
65
66
if self .settings .compiler == "clang" and Version (self .version ) < "0.4.25" :
66
67
raise ConanInvalidConfiguration (f"{ self .ref } 's clang support is broken. See pistacheio/pistache#835." )
67
-
68
+
68
69
if Version (self .version ) == "0.4.25" and self .settings .os == "Windows" :
69
70
# See https://github.com/conan-io/conan-center-index/pull/26463#issuecomment-2962541819
70
71
raise ConanInvalidConfiguration ("Windows builds are broken - contributions welcome" )
@@ -83,12 +84,12 @@ def source(self):
83
84
84
85
def generate (self ):
85
86
tc = MesonToolchain (self )
86
- tc .project_options ["PISTACHE_USE_SSL" ] = self .options .with_ssl
87
+ tc .project_options ["PISTACHE_USE_SSL" ] = bool ( self .options .with_ssl )
87
88
tc .project_options ["PISTACHE_BUILD_EXAMPLES" ] = False
88
89
tc .project_options ["PISTACHE_BUILD_TESTS" ] = False
89
90
tc .project_options ["PISTACHE_BUILD_DOCS" ] = False
90
- if self ._supports_libevent :
91
- tc .project_options ["PISTACHE_FORCE_LIBEVENT" ] = self .options .get_safe ( " with_libevent" , True )
91
+ if self .settings . os == "Linux" and self . _supports_libevent :
92
+ tc .project_options ["PISTACHE_FORCE_LIBEVENT" ] = bool ( self .options .with_libevent )
92
93
tc .generate ()
93
94
deps = PkgConfigDeps (self )
94
95
deps .generate ()
@@ -121,7 +122,7 @@ def package_info(self):
121
122
122
123
self .cpp_info .components ["libpistache" ].libs = collect_libs (self )
123
124
self .cpp_info .components ["libpistache" ].requires = ["rapidjson::rapidjson" ]
124
- if self .options .get_safe ("with_libevent" , True ):
125
+ if self .settings . os != "Linux" or self . options .get_safe ("with_libevent" ):
125
126
self .cpp_info .components ["libpistache" ].requires .append ("libevent::libevent" )
126
127
self .cpp_info .components ["libpistache" ].requires .append ("date::date" )
127
128
if self .options .with_ssl :
0 commit comments