Skip to content

Commit

Permalink
[ur] Fix the build on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kbenzie committed Jul 7, 2023
1 parent 70459f4 commit 7e135f6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ include(CTest)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(helpers)

if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(CMAKE_FIND_FRAMEWORK NEVER)
endif()

find_package(Python3 COMPONENTS Interpreter)

set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -52,7 +56,7 @@ endif()
if(NOT MSVC)
add_compile_options(-fPIC -Wall -Wpedantic
$<$<CXX_COMPILER_ID:GNU>:-fdiagnostics-color=always>
$<$<CXX_COMPILER_ID:Clang>:-fcolor-diagnostics>)
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>)
if(UR_DEVELOPER_MODE)
add_compile_options(-Werror -fno-omit-frame-pointer)
endif()
Expand Down
4 changes: 4 additions & 0 deletions source/common/ur_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ inline int ur_getpid(void) { return static_cast<int>(getpid()); }
#define MAKE_LIBRARY_NAME(NAME, VERSION) NAME ".dll"
#else
#define HMODULE void *
#if defined(__APPLE__)
#define MAKE_LIBRARY_NAME(NAME, VERSION) "lib" NAME "." VERSION ".dylib"
#else
#define MAKE_LIBRARY_NAME(NAME, VERSION) "lib" NAME ".so." VERSION
#endif
#endif

inline std::string create_library_path(const char *name, const char *path) {
std::string library_path;
Expand Down

0 comments on commit 7e135f6

Please sign in to comment.