| 25 | return version |
| 26 | |
| 27 | class IpcRecipe(ConanFile): |
| 28 | name = "ipc" |
| 29 | version = load_version_from_file("./VERSION") |
| 30 | settings = "os", "compiler", "build_type", "arch" |
| 31 | |
| 32 | DOXYGEN_VERSION = "1.9.4" |
| 33 | |
| 34 | options = { |
| 35 | "build": [True, False], |
| 36 | "build_no_lto": [True, False], |
| 37 | |
| 38 | # Replaces the core C/C++ compiler flags (not linker flags) for the chosen settings.build_type. |
| 39 | # Note that these appear *after* any C[XX]FLAGS and tools.build.c[xx]flags |
| 40 | # on the compiler command line, so it would not be |
| 41 | # sufficient to instead add the desired flags to tools.build* or *FLAGS, as if a setting in |
| 42 | # the core CMake-chosen flags conflicts with one of those, the core one wins due to being last on command |
| 43 | # line. Long story short, this is for the core flags, typically: -O<something> [-g] [-DNDEBUG]. |
| 44 | # So default for, e.g., RelWithDebInfo in Linux = -O2 -g -DNDEBUG; and one could set |
| 45 | # this option to "-O3 -g -DNDEBUG" to increase the optimization level. |
| 46 | # |
| 47 | # This affects `ipc` CMake only; meaning flow, ipc_*, ipc objects will have this overridden; while |
| 48 | # Boost libs, jemalloc lib, capnp/kj, gtest libs will build how they would've built anyway. |
| 49 | "build_type_cflags_override": "ANY", |
| 50 | |
| 51 | # 0 => default (let build script decide, as of this writing 17 meaning C++17) or a #, probably `20` as of |
| 52 | # this writing. |
| 53 | "build_cxx_std": ["ANY"], |
| 54 | "doc": [True, False], |
| 55 | } |
| 56 | |
| 57 | default_options = { |
| 58 | "build": True, |
| 59 | "build_no_lto": False, |
| 60 | "build_type_cflags_override": "", |
| 61 | "build_cxx_std": 0, |
| 62 | "doc": False, |
| 63 | } |
| 64 | |
| 65 | def configure(self): |
| 66 | if self.options.build: |
| 67 | self.options["jemalloc"].enable_cxx = False |
| 68 | self.options["jemalloc"].prefix = "je_" |
| 69 | |
| 70 | def generate(self): |
| 71 | deps = CMakeDeps(self) |
| 72 | if self.options.doc: |
| 73 | deps.build_context_activated = [f"doxygen/{self.DOXYGEN_VERSION}"] |
| 74 | deps.generate() |
| 75 | |
| 76 | toolchain = CMakeToolchain(self) |
| 77 | if self.options.build: |
| 78 | toolchain.variables["CFG_ENABLE_TEST_SUITE"] = "ON" |
| 79 | |
| 80 | # We're not doing anything wrong here; we tell jemalloc itself to be built with this |
| 81 | # API-name prefix via options.jemalloc.prefix, and then we tell Flow-IPC CMake script(s) what that was via |
| 82 | # FLOW_IPC_JEMALLOC_PREFIX CMake variable (as if via `-DFLOW_IPC_JEMALLOC_PREFIX=je_` to `cmake`). But: |
| 83 | # Flow-IPC CMake script(s) can figure this out by itself; if FLOW_IPC_JEMALLOC_PREFIX is not given, then |
| 84 | # it finds jemalloc-config binary, which a normal jemalloc install would put into (install-prefix)/bin, |
nothing calls this directly
no test coverage detected