Skip to content

Commit cefac32

Browse files
committed
Add options for callback handler, disable exceptions and 64bit index type
1 parent 0fd19a6 commit cefac32

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

CDT/conanfile.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ class CDTConan(ConanFile):
2222
"header_only": [True, False],
2323
"enable_callback_handler": [True, False],
2424
"enable_testing": [True, False],
25+
"no_exceptions": [True, False],
26+
"use_64_bit_index_type": [True, False],
2527
}
2628
default_options = {
2729
"shared": False,
2830
"fPIC": True,
2931
"header_only": False,
3032
"enable_callback_handler": False,
3133
"enable_testing": False,
34+
"no_exceptions": False,
35+
"use_64_bit_index_type": False,
3236
}
3337
exports_sources = "*", "!.idea", "!conanfile.py"
3438

@@ -63,11 +67,13 @@ def layout(self):
6367
def generate(self):
6468
tc = CMakeToolchain(self)
6569
tc.variables["CDT_USE_BOOST"] = self._needs_boost
66-
tc.cache_variables["CDT_USE_AS_COMPILED_LIBRARY"] = (
70+
tc.variables["CDT_USE_AS_COMPILED_LIBRARY"] = (
6771
not self.options.header_only
6872
)
69-
tc.cache_variables["CDT_ENABLE_TESTING"] = self.options.enable_testing
70-
tc.cache_variables["CDT_ENABLE_CALLBACK_HANDLER"] = self.options.enable_callback_handler
73+
tc.variables["CDT_ENABLE_CALLBACK_HANDLER"] = self.options.enable_callback_handler
74+
tc.variables["CDT_ENABLE_TESTING"] = self.options.enable_testing
75+
tc.variables["CDT_DISABLE_EXCEPTIONS"] = self.options.no_exceptions
76+
tc.variables["CDT_USE_64_BIT_INDEX_TYPE"] = self.options.use_64_bit_index_type
7177
tc.generate()
7278

7379
deps = CMakeDeps(self)
@@ -90,3 +96,9 @@ def package_info(self):
9096
self.cpp_info.defines.append("CDT_USE_BOOST")
9197
if not self.options.header_only:
9298
self.cpp_info.defines.append("CDT_USE_AS_COMPILED_LIBRARY")
99+
if self.options.enable_callback_handler:
100+
self.cpp_info.defines.append("CDT_ENABLE_CALLBACK_HANDLER")
101+
if self.options.no_exceptions:
102+
self.cpp_info.defines.append("CDT_DISABLE_EXCEPTIONS")
103+
if self.options.use_64_bit_index_type:
104+
self.cpp_info.defines.append("CDT_USE_64_BIT_INDEX_TYPE")

0 commit comments

Comments
 (0)