Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build issues on Windows #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions egl_probe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@ add_definitions(-DUSE_GLAD)
add_executable(query_devices glad/egl.cpp glad/gl.cpp query_devices.cpp)
add_executable(test_device glad/egl.cpp glad/gl.cpp test_device.cpp)

target_link_libraries(query_devices dl pthread)
target_link_libraries(test_device dl pthread)

IF(WIN32)
SET(PLATFORM_LIBS)
ELSE(WIN32)
SET(PLATFORM_LIBS dl pthread)
ENDIF(WIN32)

target_link_libraries(query_devices ${PLATFORM_LIBS})
target_link_libraries(test_device ${PLATFORM_LIBS})
4 changes: 3 additions & 1 deletion egl_probe/query_devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#ifndef _WIN32
#include <unistd.h>
#endif

#ifdef USE_GLAD
#include <glad/egl.h>
Expand Down
4 changes: 3 additions & 1 deletion egl_probe/test_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.h>
#ifndef _WIN32
#include <unistd.h>
#endif

#ifdef USE_GLAD
#include <glad/egl.h>
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def build_extension(self, ext):
os.mkdir(build_dir)

# build using cmake
subprocess.check_call("cmake ..; make -j", cwd=build_dir, shell=True)
subprocess.check_call("cmake -S .. -B .", cwd=build_dir, shell=True)
subprocess.check_call("cmake --build .", cwd=build_dir, shell=True)


if sys.version_info.major == 3:
Expand Down