[Bf-blender-cvs] [8cbfc4f] soc-2014-viewport_context: Merge branch 'master' into soc-2014-viewport_context
Campbell Barton
noreply at git.blender.org
Mon Jul 28 19:58:26 CEST 2014
Commit: 8cbfc4f370081e2e6e8eb13842227624486486b4
Author: Campbell Barton
Date: Tue Jul 29 03:58:04 2014 +1000
Branches: soc-2014-viewport_context
https://developer.blender.org/rB8cbfc4f370081e2e6e8eb13842227624486486b4
Merge branch 'master' into soc-2014-viewport_context
Conflicts:
CMakeLists.txt
===================================================================
===================================================================
diff --cc CMakeLists.txt
index ad49132,8be3a9b..937678d
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@@ -2222,75 -2062,16 +2224,69 @@@ endif(
if(WITH_SYSTEM_GLEW)
find_package(GLEW)
+ # Note: There is an assumption here that the system GLEW is not a static library.
+
if(NOT GLEW_FOUND)
- message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
- message(FATAL_ERROR "GLEW is required to build blender, install it or disable WITH_SYSTEM_GLEW")
++ message(FATAL_ERROR "GLEW is required to build Blender. Install it or disable WITH_SYSTEM_GLEW.")
endif()
- mark_as_advanced(
- GLEW_LIBRARY
- GLEW_INCLUDE_PATH
- )
-
- set(GLEW_INCLUDE_PATH "${GLEW_INCLUDE_DIRS}")
+ set(BLENDER_GLEW_LIBRARIES ${GLEW_LIBRARY})
-
else()
- # set(GLEW_LIBRARY "") # unused
- set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
+ if(WITH_GLEW_ES)
+ set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew-es/include")
+
+ list(APPEND GL_DEFINITIONS -DGLEW_STATIC -DWITH_GLEW_ES)
+
+ # These definitions remove APIs from glew.h, making GLEW smaller, and catching unguarded API usage
+ if(NOT WITH_GL_PROFILE_ES20)
+ # No ES functions are needed
+ list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
+ elseif(NOT (WITH_GL_PROFILE_CORE OR WITH_GL_PROFILE_COMPAT))
+ # ES is enabled, but the other functions are all disabled
+ list(APPEND GL_DEFINITIONS -DGLEW_ES_ONLY)
+ endif()
+
+ if(WITH_GL_PROFILE_ES20)
+ if(WITH_GL_EGL)
+ list(APPEND GL_DEFINITIONS -DGLEW_USE_LIB_ES20)
+ endif()
+
+ # ToDo: This is an experiment to eliminate ES 1 symbols,
+ # GLEW doesn't really properly provide this level of control
+ # (for example, without modification it eliminates too many symbols)
+ # so there are lots of modifications to GLEW to make this work,
+ # and no attempt to make it work beyond Blender at this point.
+ list(APPEND GL_DEFINITIONS -DGL_ES_VERSION_1_0=0 -DGL_ES_VERSION_CL_1_1=0 -DGL_ES_VERSION_CM_1_1=0)
+ endif()
+
+ if(WITH_GL_EGL)
+ list(APPEND GL_DEFINITIONS -DGLEW_INC_EGL)
+ endif()
+
+ set(BLENDER_GLEW_LIBRARIES extern_glew_es bf_intern_glew_mx)
+
+ else()
+ set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
+
+ list(APPEND GL_DEFINITIONS -DGLEW_STATIC)
+
+ # This won't affect the non-experimental glew library,
+ # but is used for conditional compilation elsewhere.
+ list(APPEND GL_DEFINITIONS -DGLEW_NO_ES)
+
+ set(BLENDER_GLEW_LIBRARIES extern_glew)
+
+ endif()
+
+endif()
+
+if(WITH_GLEW_MX)
+ list(APPEND BLENDER_GLEW_LIBRARIES bf_intern_glew_mx)
endif()
+if(NOT WITH_GLU)
+ list(APPEND GL_DEFINITIONS -DGLEW_NO_GLU)
+endif()
#-----------------------------------------------------------------------------
# Configure Bullet
More information about the Bf-blender-cvs
mailing list