Skip to content

Commit

Permalink
change build files for arm macs
Browse files Browse the repository at this point in the history
  • Loading branch information
Apfelbeet committed Jan 2, 2024
1 parent 4e24d07 commit 65941a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
10 changes: 4 additions & 6 deletions lib/sharp_sat_ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ fn main() {
//Link SharpSat
println!("cargo:rustc-link-search={}", build_dst.join("build").display());
println!("cargo:rustc-link-lib=static={lib_name}");
if os == "macos" && arch == "aarch64" {
println!("cargo:rustc-link-search=/opt/homebrew/include/Cellar/gmp/6.3.0/include");
}

//Link other stuff

println!("cargo:rustc-link-lib=gmpxx");
println!("cargo:rustc-link-lib=gmp");


//Build Bridge between SharpSAT Wrapper and LogicNG
let mut build = cxx_build::bridge("src/lib.rs");
build
.include(sharp_sat_path.join("include/"))
// .flag("-w")
.file("sharp_sat_wrapper/library.cpp");
build.include(sharp_sat_path.join("include/")).flag("-w").file("sharp_sat_wrapper/library.cpp");

if os == "macos" && arch == "aarch64" {
build.include("/opt/homebrew/include");
Expand Down
2 changes: 1 addition & 1 deletion lib/sharp_sat_ffi/sharp_sat/logicng-sharp-sat
15 changes: 9 additions & 6 deletions lib/sharp_sat_ffi/sharp_sat_wrapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
endif ()

IF(UNIX)
IF(APPLE)
# include_directories(/opt/local/include)
include_directories(/usr/local/Cellar/gmp/6.3.0/include)
ELSE(APPLE)

ENDIF(APPLE)
IF(APPLE)
IF(CMAKE_APPLE_SILICON_PROCESSOR)
include_directories(/opt/homebrew/include/Cellar/gmp/6.3.0/include)
ELSE(CMAKE_APPLE_SILICON_PROCESSOR)
include_directories(/usr/local/Cellar/gmp/6.3.0/include)
ENDIF(CMAKE_APPLE_SILICON_PROCESSOR)
ELSE(APPLE)

ENDIF(APPLE)
ELSE(UNIX)

ENDIF(UNIX)
Expand Down

0 comments on commit 65941a3

Please sign in to comment.