Skip to content

Commit 3663a76

Browse files
committed
Fixes issues which occur when building on Apple Silicon
Stopped Cuda library been loaded when on Apple sets CMAKE_SHARED_LIBRARY_SUFFIX without hardcoding
1 parent 4eac1ca commit 3663a76

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cmake/CppInterOp/CppInterOpConfig.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}"
66
get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}" PATH)
77
get_filename_component(CPPINTEROP_INSTALL_PREFIX "${CPPINTEROP_INSTALL_PREFIX}" PATH)
88

9+
# Determine CMAKE_SHARED_LIBRARY_SUFFIX based on operating system
10+
include(CMakeSystemSpecificInformation)
11+
912
### build/install workaround
1013

1114
if (IS_DIRECTORY "${CPPINTEROP_INSTALL_PREFIX}/include")

lib/Interpreter/Compatibility.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ createClangInterpreter(std::vector<const char*>& args) {
9696
};
9797
auto it = std::find_if(args.begin(), args.end(), has_arg);
9898
std::vector<const char*> gpu_args = {it, args.end()};
99-
bool CudaEnabled = !gpu_args.empty();
99+
#ifdef __APPLE__
100+
bool CudaEnabled = false;
101+
#else
102+
bool CudaEnabled = !gpu_args.empty();
103+
#endif
100104

101105
clang::IncrementalCompilerBuilder CB;
102106
CB.SetCompilerArgs({args.begin(), it});

0 commit comments

Comments
 (0)