Get extapi.bc file path in npm
| 97 | |
| 98 | // Get extapi.bc file path in npm |
| 99 | static std::string getFilePath(const std::string& path) |
| 100 | { |
| 101 | std::string bcFilePath = ""; |
| 102 | if (path.compare("SVF_DIR") == 0) |
| 103 | { |
| 104 | char const* svfdir = getenv("SVF_DIR"); |
| 105 | if (svfdir) |
| 106 | bcFilePath = svfdir; |
| 107 | if (!bcFilePath.empty() && bcFilePath.back() != '/') |
| 108 | bcFilePath.push_back('/'); |
| 109 | bcFilePath.append(SVF_BUILD_TYPE "-build").append("/lib/extapi.bc"); |
| 110 | } |
| 111 | else if (path.compare("npm root") == 0) |
| 112 | { |
| 113 | bcFilePath = GetStdoutFromCommand(path); |
| 114 | if (!bcFilePath.empty() && bcFilePath.back() != '/') |
| 115 | bcFilePath.push_back('/'); |
| 116 | bcFilePath.append("SVF/lib/extapi.bc"); |
| 117 | } |
| 118 | return bcFilePath; |
| 119 | } |
| 120 | |
| 121 | // This function returns the absolute path of the current module: |
| 122 | // - If SVF is built and loaded as a dynamic library (e.g., libSVFCore.so or .dylib), it returns the path to that shared object file. |
no test coverage detected