diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-27 23:19:15 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-27 23:19:15 +1000 |
commit | 6b004c5ac6a25f1020774276803b62e8619ea61e (patch) | |
tree | fe8f4113b5454cec2f293098acc9a2f5ef0595de | |
parent | ca4c92f7b74ebbfc80bd24630cd0ad3def6c20fc (diff) |
env var for static lib
-rw-r--r-- | bindgen/rust/celeritas-sys/build.rs | 6 | ||||
-rw-r--r-- | src/new_render/render.c | 23 |
2 files changed, 16 insertions, 13 deletions
diff --git a/bindgen/rust/celeritas-sys/build.rs b/bindgen/rust/celeritas-sys/build.rs index e2c240b..13aa04d 100644 --- a/bindgen/rust/celeritas-sys/build.rs +++ b/bindgen/rust/celeritas-sys/build.rs @@ -31,8 +31,12 @@ fn main() { // Tell cargo to look for shared libraries in the specified directory // TODO: we need to look based on OS - println!("cargo:rustc-link-search=../../../build/macosx/arm64/debug"); // println!("cargo:rustc-link-search=../../build/windows/x64/debug"); + + let static_lib_path = std::env::var("CELERITAS_CORE_LIB") + .unwrap_or("../../../build/macosx/arm64/debug".to_string()); + + println!("cargo:rustc-link-search={static_lib_path}"); // Tell cargo to tell rustc to link the system bzip2 // shared library. diff --git a/src/new_render/render.c b/src/new_render/render.c index 49b2bf9..9314871 100644 --- a/src/new_render/render.c +++ b/src/new_render/render.c @@ -273,20 +273,19 @@ void Geometry_Destroy(Geometry* geometry) { } } -size_t ModelExtractRenderEnts(RenderEnt_darray* entities, ModelHandle model_handle, Mat4 affine, RenderEntityFlags flags) { - Model* model = MODEL_GET(model_handle); - for (u32 i = 0; i < model->mesh_count; i++) { +size_t ModelExtractRenderEnts(RenderEnt_darray* entities, ModelHandle model_handle, Mat4 affine, + RenderEntityFlags flags) { + Model* model = MODEL_GET(model_handle); + for (u32 i = 0; i < model->mesh_count; i++) { Mesh* m = Mesh_pool_get(Render_GetMeshPool(), model->meshes[i]); - RenderEnt data = { - .mesh = model->meshes[i], - .material = m->material, - .affine = affine, - // .bounding_box - .flags = flags - }; + RenderEnt data = { .mesh = model->meshes[i], + .material = m->material, + .affine = affine, + // .bounding_box + .flags = flags }; RenderEnt_darray_push(entities, data); - } - return model->mesh_count; // how many RenderEnts we pushed + } + return model->mesh_count; // how many RenderEnts we pushed } void SetCamera(Camera camera) { g_core.renderer->scene.camera = camera; } |