summaryrefslogtreecommitdiff
path: root/dispatch
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-08-09 16:58:38 +0100
committerJose Fonseca <jfonseca@vmware.com>2016-08-09 16:58:38 +0100
commit9022a435da9269710a5056a9161c65c901e6cac7 (patch)
tree9309858ae4ceca46daf1f88e74f65ebc3d81e38d /dispatch
parent8fa3a333671fd940c9557f39b9d4fdbaeee186fa (diff)
cmake: Prevent glproc.py from being called multiple times simultaneously.
CMake generated Visual Studio project files seem to attach the custom command to every project (target) that uses them. glproc.cpp was being used in two targets, and consequently glproc.py was being call multiple times, often simultanouelsy, causing the build to abort (particularly on AppVeyor.) Putting the glproc.cpp in a single static library seems to avoid the issue reliably.
Diffstat (limited to 'dispatch')
-rw-r--r--dispatch/CMakeLists.txt19
1 files changed, 8 insertions, 11 deletions
diff --git a/dispatch/CMakeLists.txt b/dispatch/CMakeLists.txt
index d023e6e9..ddb38153 100644
--- a/dispatch/CMakeLists.txt
+++ b/dispatch/CMakeLists.txt
@@ -11,8 +11,9 @@ add_custom_command (
${CMAKE_CURRENT_SOURCE_DIR}/glproc.py
${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
${CMAKE_CURRENT_BINARY_DIR}/glproc.cpp
- DEPENDS
+ MAIN_DEPENDENCY
glproc.py
+ DEPENDS
dispatch.py
${CMAKE_SOURCE_DIR}/specs/wglapi.py
${CMAKE_SOURCE_DIR}/specs/glxapi.py
@@ -24,28 +25,24 @@ add_custom_command (
)
-# Wrap glproc.hpp as a target to prevent the command from being executed
-# multiple times simulatenously, when the targets that depend on it are built
-# in parallel.
-add_custom_target (glproc DEPENDS
+# Wrap glproc.{hpp,cpp} as a target to prevent the command from being executed
+# multiple times simultanously, when the targets that depend on it are built in
+# parallel.
+add_convenience_library (glproc EXCLUDE_FROM_ALL
${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
${CMAKE_CURRENT_BINARY_DIR}/glproc.cpp
)
-
add_convenience_library (glproc_gl EXCLUDE_FROM_ALL
glproc_gl.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/glproc.cpp
)
-
add_dependencies (glproc_gl glproc)
+target_link_libraries (glproc_gl glproc)
if (ENABLE_EGL)
add_convenience_library (glproc_egl EXCLUDE_FROM_ALL
glproc_egl.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/glproc.cpp
)
-
add_dependencies (glproc_egl glproc)
+ target_link_libraries (glproc_egl glproc)
endif ()
-