Skip to content
Open
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
19 changes: 18 additions & 1 deletion src/qml.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// system headers
#include <filesystem>

#ifdef __FreeBSD__
#include <sys/sysctl.h>
#endif

// library includes
#include <nlohmann/json.hpp>
#include <linuxdeploy/core/appdir.h>
Expand All @@ -22,7 +26,20 @@ using namespace nlohmann;
namespace fs = std::filesystem;

fs::path findQmlImportScanner() {
return which("qmlimportscanner");
auto path = which("qmlimportscanner");
#ifdef __FreeBSD__
int mib[2];
char buf[PATH_MAX];
size_t len = PATH_MAX;

mib[0] = CTL_USER;
mib[1] = USER_LOCALBASE;
if (::sysctl(mib, 2, buf, &len, NULL, 0) != 0)
return path;

path = which(std::string(buf) + "/libexec/qt6/qmlimportscanner");
#endif
return path;
}

std::string runQmlImportScanner(const std::vector<std::filesystem::path> &sourcesPaths, const std::vector<fs::path> &qmlImportPaths) {
Expand Down