* This function checks if the falcor module is loaded from a Falcor * application running the embedded python interpreter (e.g. Mogwai). */
| 36 | * application running the embedded python interpreter (e.g. Mogwai). |
| 37 | */ |
| 38 | static bool isLoadedFromEmbeddedPython() |
| 39 | { |
| 40 | try |
| 41 | { |
| 42 | auto os = pybind11::module::import("os"); |
| 43 | std::string value = os.attr("environ")["FALCOR_EMBEDDED_PYTHON"].cast<pybind11::str>(); |
| 44 | return value == "1"; |
| 45 | } |
| 46 | catch (const std::exception&) |
| 47 | {} |
| 48 | |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | PYBIND11_MODULE(falcor_ext, m) |
| 53 | { |