Delete old code #55

Merged
davidgmbb merged 12 commits from delete-old-code into main 2025-06-27 21:00:53 +00:00
4 changed files with 29 additions and 0 deletions
Showing only changes of commit 9508cd7275 - Show all commits

View File

@ -77,6 +77,8 @@ O = bits u32
[extern] memcpy = fn [cc(c)] (destination: &u8, source: &u8, byte_count: u64) &u8; [extern] memcpy = fn [cc(c)] (destination: &u8, source: &u8, byte_count: u64) &u8;
[extern] exit = fn [cc(c)] (exit_code: int) noreturn; [extern] exit = fn [cc(c)] (exit_code: int) noreturn;
[extern] getenv = fn [cc(c)] (env: &u8) &u8;
[extern] realpath = fn [cc(c)] (source_path: &u8, resolved_path: &u8) &u8; [extern] realpath = fn [cc(c)] (source_path: &u8, resolved_path: &u8) &u8;
[extern] mkdir = fn [cc(c)] (path: &u8, mode: mode_t) int; [extern] mkdir = fn [cc(c)] (path: &u8, mode: mode_t) int;
@ -18356,6 +18358,16 @@ compile_file = fn (arena: &Arena, compile_options: CompileFile, envp: &&u8) []u8
.value = CMAKE_PREFIX_PATH, .value = CMAKE_PREFIX_PATH,
}; };
if (is_compiler)
{
>cmake_prefix_path_cstr = getenv("CMAKE_PREFIX_PATH");
if (cmake_prefix_path_cstr)
{
>cmake_prefix_path_value = c_string_to_slice(cmake_prefix_path_cstr);
cmake_prefix_path_definition.value = cmake_prefix_path_value;
}
}
>objects = [ output_object_path ][..]; >objects = [ output_object_path ][..];
>c_abi_library = "build/libc_abi.a"; >c_abi_library = "build/libc_abi.a";
>llvm_bindings_library = "build/libllvm_bindings.a"; >llvm_bindings_library = "build/libllvm_bindings.a";

View File

@ -221,6 +221,16 @@ fn String compile_file(Arena* arena, Compile options)
.value = cmake_prefix_path, .value = cmake_prefix_path,
}; };
if (is_compiler)
{
auto cmake_prefix_path_cstr = os_get_environment_variable("CMAKE_PREFIX_PATH");
if (cmake_prefix_path_cstr)
{
auto cmake_prefix_path_string = c_string_to_slice(cmake_prefix_path_cstr);
cmake_prefix_path_definition.value = cmake_prefix_path_string;
}
}
String objects[] = { String objects[] = {
output_object_path, output_object_path,
}; };

View File

@ -225,3 +225,9 @@ Execution os_execute(Arena* arena, Slice<char* const> arguments, Slice<char* con
return execution; return execution;
} }
extern "C" char* getenv(const char*);
char* os_get_environment_variable(const char* env)
{
return getenv(env);
}

View File

@ -719,3 +719,4 @@ struct Execution
}; };
Execution os_execute(Arena* arena, Slice<char* const> arguments, Slice<char* const> environment, ExecuteOptions options); Execution os_execute(Arena* arena, Slice<char* const> arguments, Slice<char* const> environment, ExecuteOptions options);
char* os_get_environment_variable(const char* env);