Skip to content

Commit

Permalink
Added fixes which caused issues building on Apple Silicon (#170)
Browse files Browse the repository at this point in the history
* Fixes issues which occur when building on Apple Silicon

Stopped Cuda library been loaded when on Apple
and sets CMAKE_SHARED_LIBRARY_SUFFIX without hardcoding
  • Loading branch information
mcbarton authored Nov 22, 2023
1 parent 4eac1ca commit 900d311
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/CppInterOp/CppInterOpConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}"
get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}" PATH)
get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}" PATH)

# Determine CMAKE_SHARED_LIBRARY_SUFFIX based on operating system
include(CMakeSystemSpecificInformation)

### build/install workaround

if (IS_DIRECTORY "${CPPINTEROP_INSTALL_PREFIX}/include")
Expand Down
4 changes: 4 additions & 0 deletions lib/Interpreter/Compatibility.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ createClangInterpreter(std::vector<const char*>& args) {
};
auto it = std::find_if(args.begin(), args.end(), has_arg);
std::vector<const char*> gpu_args = {it, args.end()};
#ifdef __APPLE__
bool CudaEnabled = false;
#else
bool CudaEnabled = !gpu_args.empty();
#endif

clang::IncrementalCompilerBuilder CB;
CB.SetCompilerArgs({args.begin(), it});
Expand Down

0 comments on commit 900d311

Please sign in to comment.