From e62eaea794b72b888d8316331611961b3a32da3b Mon Sep 17 00:00:00 2001 From: Mike Smith Date: Tue, 27 Aug 2024 23:07:28 +0800 Subject: [PATCH] fix compatibility with linux --- luisa_compute/Cargo.toml | 1 + luisa_compute_sys/Cargo.toml | 1 + luisa_compute_sys/build.rs | 4 +++- luisa_compute_sys/llvm_dummy_orc/CMakeLists.txt | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/luisa_compute/Cargo.toml b/luisa_compute/Cargo.toml index 9cb632a..58472ab 100644 --- a/luisa_compute/Cargo.toml +++ b/luisa_compute/Cargo.toml @@ -47,5 +47,6 @@ strict = ["luisa_compute_sys/strict"] remote = ["luisa_compute_sys/remote"] cpu = ["luisa_compute_sys/cpu"] oidn = ["luisa_compute_sys/oidn"] +wayland = ["luisa_compute_sys/wayland"] glam = ["dep:glam"] nalgebra = ["dep:nalgebra"] diff --git a/luisa_compute_sys/Cargo.toml b/luisa_compute_sys/Cargo.toml index e032c3c..36de9c5 100644 --- a/luisa_compute_sys/Cargo.toml +++ b/luisa_compute_sys/Cargo.toml @@ -21,4 +21,5 @@ remote = [] metal = [] dx = [] oidn = [] +wayland = [] diff --git a/luisa_compute_sys/build.rs b/luisa_compute_sys/build.rs index 8e84c15..f35f522 100644 --- a/luisa_compute_sys/build.rs +++ b/luisa_compute_sys/build.rs @@ -50,6 +50,7 @@ fn cmake_build() -> PathBuf { set_from_env!("PYTHON", "LUISA_COMPUTE_ENABLE_PYTHON"); set_from_env!("GUI", "LUISA_COMPUTE_ENABLE_GUI"); set_from_env!("OIDN", "LUISA_COMPUTE_DOWNLOAD_OIDN"); + set_from_env!("WAYLAND", "LUISA_COMPUTE_ENABLE_WAYLAND"); config.define( "LUISA_COMPUTE_CHECK_BACKEND_DEPENDENCIES", if cfg!(feature = "strict") { @@ -199,10 +200,11 @@ fn main() { { println!("rerun-if-changed=./llvm_dummy_orc"); let out = cmake::Config::new("./llvm_dummy_orc") + .generator("Ninja") .build_target("dummy_orc_eh") .build(); dbg!(&out); - println!("cargo:rustc-link-lib=dylib=dummy_orc_eh"); + println!("cargo:rustc-link-lib=static=dummy_orc_eh"); println!("cargo:rustc-link-search=native={}/build", out.display()); } } diff --git a/luisa_compute_sys/llvm_dummy_orc/CMakeLists.txt b/luisa_compute_sys/llvm_dummy_orc/CMakeLists.txt index 808183d..c8419ba 100644 --- a/luisa_compute_sys/llvm_dummy_orc/CMakeLists.txt +++ b/luisa_compute_sys/llvm_dummy_orc/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 3.15) project(dummy_orc_eh) -add_library(dummy_orc_eh SHARED dummy_orc_eh.cc) \ No newline at end of file +add_library(dummy_orc_eh STATIC dummy_orc_eh.cc) +set_property(TARGET dummy_orc_eh PROPERTY POSITION_INDEPENDENT_CODE ON)