This commit is contained in:
ZtRXR 2024-06-28 22:17:41 +08:00
parent 36f2c3e50a
commit 0c2fd4a6be
3 changed files with 3 additions and 18 deletions

View File

@ -7,7 +7,7 @@ find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(${PROJECT_NAME} ${SRC})
add_subdirectory( ${PROJECT_SOURCE_DIR}/glew/build/cmake )
add_subdirectory( ${PROJECT_SOURCE_DIR}/glew-cmake )
add_subdirectory( ${PROJECT_SOURCE_DIR}/glfw )
target_link_libraries(${PROJECT_NAME} PRIVATE glfw)
find_package(OpenGl REQUIRED)

17
make.py
View File

@ -1,17 +0,0 @@
from pymake import *
(
cmake("3.15")
.set(cmake_export_compile_commands, on)
.project("test_pybind11")
.file("SRC",glob_recurse,"src/*.cpp")
.just_add("""find_package(Python 3.12.3 COMPONENTS Interpreter Development REQUIRED)""")
.just_add("find_package(pybind11 CONFIG REQUIRED)")
.add_subdirectory("glfw")
.target_link_libraries(var(project_name),"glfw")
.find_package("OpenGl")
.target_link_libraries(var(project_name),"OpenGL::GL")
.pybind11_add_module(var(project_name),var("SRC"))
.write()
)

View File

@ -10,6 +10,8 @@ int tests::glfw_window(unsigned width,unsigned height, std::string title)
if (!glfwInit())
return -1;
/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(width, height, title.c_str(), NULL, NULL);
if (!window)