Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions mod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ void Python3Module::compile(maiken::Application& a, YAML::Node const& node) KTHR
VALIDATE_NODE(node);

std::vector<std::string> incs{py_include()};
#if defined(_WIN32) // or fallback
incs.push_back(kul::Dir{"include", python_exe.dir()}.escm());
#endif

try {
if (node["with"]) {
Expand All @@ -197,8 +200,7 @@ void Python3Module::compile(maiken::Application& a, YAML::Node const& node) KTHR
if (req_include) {
a.addInclude(req_include.real());
for (auto* rep : a.revendencies()) rep->addInclude(req_include.real());
} else
throw std::runtime_error("include doesn't exist: " + req_include.real());
}
}
} catch (kul::Exception const& e) {
KERR << e.stack();
Expand All @@ -213,7 +215,6 @@ void Python3Module::link(maiken::Application& a, YAML::Node const& node) KTHROW(
VALIDATE_NODE(node);

auto const embed = kul::String::BOOL(kul::env::GET("MKN_PYTHON_LIB_EMBED", "0"));

auto linker = py_cflags();
auto const libpath = py_libdir();
auto const prefx = py_prefix();
Expand All @@ -227,6 +228,12 @@ void Python3Module::link(maiken::Application& a, YAML::Node const& node) KTHROW(
}
}

#if defined(_WIN32) // or fallback
if (prefx.size())
if (auto const lib = kul::Dir{"libs", python_exe.dir()}) // windows fallback
a.addLibpath(lib.escm());
#endif

if (embed) a.addLib(py_libname());

if (a.mode() != maiken::compiler::Mode::STAT) a.prependLinkString(linker);
Expand Down
1 change: 1 addition & 0 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
std::string const yArgs = "";

int main(int argc, char* argv[]) {
KOUT(NON) << __FILE__;
mkn::kul::Signal sig;
try {
YAML::Node node = mkn::kul::yaml::String(yArgs).root();
Expand Down
Loading