clang support

This commit is contained in:
fxia22 2019-04-29 16:50:52 -07:00
parent ff0f2e8028
commit 274f077c27
5 changed files with 8 additions and 3 deletions

View File

@ -5,14 +5,14 @@ include_directories(glad)
find_package(OpenGL)
add_subdirectory(pybind11)
add_library(CppMeshRenderer MODULE glad/egl.c glad/gl.c cpp/Mesh_renderer.cpp)
add_library(CppMeshRenderer MODULE glad/egl.cpp glad/gl.cpp cpp/Mesh_renderer.cpp)
target_link_libraries(CppMeshRenderer PRIVATE pybind11::module dl pthread EGL ${OPENGL_LIBRARIES})
set_target_properties(CppMeshRenderer PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}")
add_executable(query_devices glad/egl.c glad/gl.c cpp/query_devices.cpp)
add_executable(test_device glad/egl.c glad/gl.c cpp/test_device.cpp)
add_executable(query_devices glad/egl.cpp glad/gl.cpp cpp/query_devices.cpp)
add_executable(test_device glad/egl.cpp glad/gl.cpp cpp/test_device.cpp)
target_link_libraries(query_devices dl pthread EGL ${OPENGL_LIBRARIES})
target_link_libraries(test_device dl pthread EGL ${OPENGL_LIBRARIES})

View File

@ -12,6 +12,8 @@ from distutils.version import LooseVersion
import subprocess
import platform
use_clang = False
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, sources=[])
@ -39,6 +41,9 @@ class CMakeBuild(build_ext):
'-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + os.path.join(extdir, 'gibson2/core/render/mesh_renderer', 'build'),
'-DPYTHON_EXECUTABLE=' + sys.executable]
if use_clang:
cmake_args += ['-DCMAKE_C_COMPILER=/usr/bin/clang', '-DCMAKE_CXX_COMPILER=/usr/bin/clang++']
cfg = 'Debug' if self.debug else 'Release'
build_args = ['--config', cfg]