12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
-
- #include <vector>
- #include <string>
-
- #include "BXParser.h"
-
- namespace toolchain {
-
- enum class FileType {
- C, CXX,
- };
-
- enum class TargetType {
- BINARY,
- SHARED_LIBRARY,
- STATIC_LIBRARY,
- };
-
- std::string objectFilePath(const std::string &path, const std::string &outDir);
- std::string targetFilePath(
- TargetType type,
- const std::string &path,
- const std::string &outDir);
-
- void getFlags(const BXVariables &vars, FileType type, std::vector<std::string> &flags);
- void getLDLibs(const BXVariables &vars, std::vector<std::string> &flags);
- void getLDFlags(const BXVariables &vars, std::vector<std::string> &flags);
-
- std::vector<std::string> getDependencies(
- const std::vector<std::string> &flags,
- FileType type,
- const std::string &path);
-
- std::vector<std::string> getCompileCommand(
- const std::vector<std::string> &flags,
- FileType type,
- const std::string &path,
- const std::string &outDir);
-
- // TODO: Don't rely on FileType, just use LD and let the dependency graph nodes
- // provide the necessary flags to link with libstdc++
- std::vector<std::string> getLinkCommand(
- const std::vector<std::string> &ldFlags,
- const std::vector<std::string> &ldLibs,
- FileType type,
- TargetType targetType,
- const std::vector<std::string> &objs,
- const std::string &path,
- const std::string &outDir);
-
- }
|