Skip to content

Commit

Permalink
Tweak package
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
  • Loading branch information
mballance committed Jun 13, 2024
1 parent ab563d6 commit 0b726fb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
16 changes: 12 additions & 4 deletions python/core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,18 @@ cdef class Factory:
if _inst is None:
ext_dir = os.path.dirname(os.path.abspath(__file__))

core_lib = os.path.join(ext_dir, "libzsp-fe-parser.so")
if not os.path.isfile(core_lib):
raise Exception("Extension library core \"%s\" doesn't exist" % core_lib)

core_lib = None
build_dir = os.path.abspath(os.path.join(ext_dir, "../../build"))

for path in (
os.path.join(build_dir, "lib64"),
os.path.join(build_dir, "lib"), ext_dir):
if os.path.isfile(os.path.join(path, "libzsp-fe-parser.so")):
core_lib = os.path.join(path, "libzsp-fe-parser.so")
break

if core_lib is None:
raise Exception("Extension library core \"libzsp-fe-parser.so\" doesn't exist")
so = ctypes.cdll.LoadLibrary(core_lib)

func = so.zsp_fe_parser_getFactory
Expand Down
24 changes: 24 additions & 0 deletions python/zsp_fe_parser/pkginfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import ivpm

class PkgInfo(ivpm.PkgInfo):

def __init__(self):
pkgdir = os.path.dirname(os.path.abspath(__file__))
projdir = os.path.dirname(os.path.dirname(pkgdir))
super().__init__("zsp-fe-parser", os.path.dirname(pkgdir))

if os.path.isdir(os.path.join(projdir, "src")):
self._incdirs = [
os.path.join(projdir, "src", "include"),
os.path.join(projdir, "python")]
self._libdirs = [
os.path.join(projdir, "build", "lib"),
os.path.join(projdir, "build", "lib64")]
else:
self._incdirs = [os.path.join(pkgdir, "share", "include")]
self._libdirs = [os.path.join(pkgdir)]

self._deps = ["zuspec-parser", "zsp-arl-dm"]

self._libs = ["zsp-fe-parser"]
1 change: 1 addition & 0 deletions src/TaskBuildExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Created on:
* Author:
*/
#include <map>
#include "dmgr/impl/DebugMacros.h"
#include "vsc/dm/impl/ValRefBool.h"
#include "zsp/parser/impl/TaskGetName.h"
Expand Down
3 changes: 2 additions & 1 deletion src/TaskLinkBuiltinTypeElemFactories.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Author:
*/
#include <functional>
#include <unordered_map>
#include <vector>
#include <string>
#include "dmgr/impl/DebugMacros.h"
Expand Down Expand Up @@ -99,7 +100,7 @@ ast::IScopeChild *TaskLinkBuiltinTypeElemFactories::findElem(
const std::vector<std::string> &path,
int32_t idx) {
DEBUG_ENTER("findElem: %s", path.at(idx).c_str());
std::map<std::string, int32_t>::const_iterator it =
std::unordered_map<std::string, int32_t>::const_iterator it =
root->getSymtab().find(path.at(idx));
ast::IScopeChild *child = 0;

Expand Down

0 comments on commit 0b726fb

Please sign in to comment.