kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

hosted.h (1919B)


      1 #ifndef KIT_DRIVER_HOSTED_H
      2 #define KIT_DRIVER_HOSTED_H
      3 
      4 #include <kit/compile.h>
      5 #include <kit/os.h>
      6 #include <stdint.h>
      7 
      8 #include "driver.h"
      9 
     10 typedef KitOsHostedInputKind DriverHostedInputKind;
     11 typedef KitOsHostedInput DriverHostedInput;
     12 typedef KitOsHostedPlan DriverHostedPlan;
     13 
     14 #define DRIVER_HOSTED_INPUT_OBJECT KIT_OS_HOSTED_INPUT_OBJECT
     15 #define DRIVER_HOSTED_INPUT_ARCHIVE KIT_OS_HOSTED_INPUT_ARCHIVE
     16 #define DRIVER_HOSTED_INPUT_DSO KIT_OS_HOSTED_INPUT_DSO
     17 #define DRIVER_HOSTED_MAX_BEFORE KIT_OS_HOSTED_MAX_BEFORE
     18 #define DRIVER_HOSTED_MAX_AFTER KIT_OS_HOSTED_MAX_AFTER
     19 #define DRIVER_HOSTED_MAX_FINAL KIT_OS_HOSTED_MAX_FINAL
     20 #define DRIVER_HOSTED_MAX_INCLUDES KIT_OS_HOSTED_MAX_INCLUDES
     21 #define DRIVER_HOSTED_MAX_DEFINES KIT_OS_HOSTED_MAX_DEFINES
     22 #define DRIVER_HOSTED_MAX_LIB_SEARCH_DIRS KIT_OS_HOSTED_MAX_LIB_SEARCH_DIRS
     23 
     24 typedef struct DriverHostedRequest {
     25   DriverEnv* env;
     26   const char* tool;
     27   KitTargetSpec target;
     28   const char* sysroot;
     29   int static_link;
     30   int shared_link;
     31   int link_inputs;
     32 } DriverHostedRequest;
     33 
     34 int driver_hosted_resolve(const DriverHostedRequest* req,
     35                           DriverHostedPlan* out);
     36 void driver_hosted_plan_fini(DriverEnv* env, DriverHostedPlan* plan);
     37 
     38 /* Resolve just the hosted include + library search directories for the
     39  * request's target/sysroot -- KIT_SYSROOT or an explicit --sysroot (expanded
     40  * per target-OS layout), else the native host probe (target OS+arch == host).
     41  * No crt/libc files are bound. Fills `out` (zeroed internally; release with
     42  * driver_hosted_dirs_fini). Returns 0 on success -- `out` may legitimately be
     43  * empty when no sysroot applies and the target is not the native host; nonzero
     44  * only on allocation failure. Shared by driver_hosted_resolve and by the cc
     45  * driver's -print-search-dirs. */
     46 int driver_hosted_dirs_resolve(const DriverHostedRequest* req,
     47                                DriverHostedDirs* out);
     48 
     49 #endif