hoshi-lang dev
Yet another programming language
Loading...
Searching...
No Matches
objectLinker.cpp
Go to the documentation of this file.
1//
2// Created by XIaokang00010 on 2025/7/31.
3//
4
5#include "objectLinker.h"
6
7namespace yoi {
8 ObjectLinker::ObjectLinker(const yoi::vec<yoi::wstr> &objectPaths, const std::shared_ptr<IRBuildConfig> &config) : objectPaths(objectPaths), config(config) {
9
10 }
15 this->linkerPath = linkerPath;
16 return *this;
17 }
19 this->objectPaths = objectPaths;
20 return *this;
21 }
29 this->elysiaRuntimePath = elysiaRuntimePath;
30 return *this;
31 }
32 std::shared_ptr<IRBuildConfig> ObjectLinker::getConfig() const {
33 return config;
34 }
35 ObjectLinker &ObjectLinker::setConfig(const std::shared_ptr<IRBuildConfig> &config) {
36 this->config = config;
37 return *this;
38 }
39
41 std::filesystem::path dir = whereIsHoshiLang();
43 for (auto &path : std::filesystem::recursive_directory_iterator(dir)) {
44 if (path.path().extension() == L".lib" || path.path().extension() == L".a" ||
45 path.path().extension() == L".so" || path.path().extension() == L".dylib") {
46 files.push_back(path.path().wstring());
47 }
48 }
49 return files;
50 }
51} // namespace yoi
yoi::wstr elysiaRuntimePath
std::shared_ptr< IRBuildConfig > config
ObjectLinker & setObjectPaths(const yoi::vec< yoi::wstr > &objectPaths)
std::shared_ptr< IRBuildConfig > getConfig() const
static yoi::vec< yoi::wstr > defaultAdditionalLinkingFiles()
yoi::vec< yoi::wstr > objectPaths
ObjectLinker & setLinkerPath(const yoi::wstr &linkerPath)
yoi::wstr getLinkerPath() const
ObjectLinker & setConfig(const std::shared_ptr< IRBuildConfig > &config)
ObjectLinker & setElysiaRuntimePath(const yoi::wstr &elysiaRuntimePath)
yoi::vec< yoi::wstr > getObjectPaths() const
ObjectLinker(const yoi::vec< yoi::wstr > &objectPaths, const std::shared_ptr< IRBuildConfig > &config)
yoi::wstr linkerPath
yoi::wstr getElysiaRuntimePath() const
std::vector< t > vec
Definition def.hpp:53
std::wstring whereIsHoshiLang()
Definition def.cpp:200
std::wstring wstr
Definition def.hpp:48