Enable pyrenderdoc for Apple

It was previously marked as disabled for Apple
Required to build the python modules which are used by the testing framework
Python imports .so libraries by default, change the shared library extension to .so for python modules on Apple
This commit is contained in:
Jake Turner
2021-03-06 05:03:45 +00:00
committed by Baldur Karlsson
parent 9c787bd05d
commit faa9dbf709
2 changed files with 15 additions and 3 deletions
+1 -1
View File
@@ -334,6 +334,6 @@ install (CODE "MESSAGE(\"NB: Your paths may vary.\")")
endif() # if(ENABLE_QRENDERDOC)
# Build python modules - primarily used for constructing documentation
if(ENABLE_PYRENDERDOC AND UNIX AND NOT APPLE)
if(ENABLE_PYRENDERDOC AND UNIX)
add_subdirectory(Code/pyrenderdoc)
endif()
+14 -2
View File
@@ -28,7 +28,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
# Set up rpath to find librenderdoc.so
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib${LIB_SUFFIX}/${LIB_SUBFOLDER_TRAIL_SLASH}")
if (APPLE)
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR TRUE)
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN/:$ORIGIN/../lib${LIB_SUFFIX}/${LIB_SUBFOLDER_TRAIL_SLASH}")
endif()
# Add python library
set (CMAKE_SHARED_LINKER_FLAGS "${PYTHON_LIBRARY} ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -43,7 +49,7 @@ set_source_files_properties(${CMAKE_BINARY_DIR}/qrenderdoc/renderdoc_python.cxx
target_compile_definitions(_renderdoc ${MODULE_DEFINES})
target_include_directories(_renderdoc ${MODULE_INCLUDES})
target_link_libraries(_renderdoc PRIVATE renderdoc)
add_library(_qrenderdoc SHARED
${CMAKE_BINARY_DIR}/qrenderdoc/renderdoc_python.cxx
${CMAKE_BINARY_DIR}/qrenderdoc/qrenderdoc_python.cxx
@@ -57,6 +63,12 @@ target_compile_definitions(_qrenderdoc ${MODULE_DEFINES})
target_include_directories(_qrenderdoc ${MODULE_INCLUDES})
target_link_libraries(_qrenderdoc PRIVATE renderdoc)
# Python expects .so extension when importing shared libraries on non-Windows platform
if(APPLE)
set_target_properties(_renderdoc PROPERTIES SUFFIX ".so")
set_target_properties(_qrenderdoc PROPERTIES SUFFIX ".so")
endif()
# Don't prefix with lib, python expects a bare .so.
# Also rename to non-underscore due to this (We couldn't call the
# python library 'renderdoc' since that would clash with the