Compare commits
78 Commits
multiview
...
input_meth
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1254e98a48 | ||
![]() |
151f2467a4 | ||
![]() |
6919ea1726 | ||
![]() |
b64b18f8ac | ||
![]() |
36fc98cb0b | ||
![]() |
36652982dd | ||
![]() |
a54d863a93 | ||
![]() |
cce89d04ee | ||
![]() |
d399927749 | ||
![]() |
80496abbf4 | ||
![]() |
b2a5b96ff4 | ||
![]() |
4fc691f619 | ||
![]() |
316bae9fe8 | ||
![]() |
3e5962656a | ||
![]() |
1087b9236f | ||
![]() |
a677da8638 | ||
![]() |
b5cf3cd415 | ||
![]() |
f65879fd51 | ||
![]() |
ff27b12904 | ||
![]() |
30654e186f | ||
![]() |
60a035c52a | ||
fde03ec578 | |||
0f159b7306 | |||
98beae0c11 | |||
![]() |
b68166355a | ||
2bf7215130 | |||
14502a3557 | |||
e0283f8b6c | |||
fffc35c34a | |||
8299602f1f | |||
3d6b912293 | |||
4a55637a0d | |||
4135458c3d | |||
c3eab0e2f4 | |||
9901eed588 | |||
48b3a09c41 | |||
ea671a6e87 | |||
a36778ab8e | |||
b4337e870e | |||
ed01da08fd | |||
e2855b81a4 | |||
6650436d4a | |||
e2e69f6011 | |||
6147ad3596 | |||
b0ea6aecb3 | |||
a7536dfac5 | |||
d472651713 | |||
808c6e383b | |||
70dee80a8b | |||
77447f0401 | |||
157e6ef22d | |||
78b91eb23f | |||
c6b2422db0 | |||
d6931a6ce6 | |||
d5e0613d6e | |||
6a6336ce77 | |||
e0b960a77e | |||
7bd15aa347 | |||
bbe68ddf7e | |||
339147666a | |||
716642379f | |||
b6192bfa3b | |||
15a212ee06 | |||
d813f70382 | |||
3e5de9dc3f | |||
656b868db9 | |||
aee3d19082 | |||
56d4aed17d | |||
c6acfdf2a0 | |||
![]() |
baccf32076 | ||
![]() |
e42f974ae6 | ||
![]() |
122ad8ac6d | ||
![]() |
f086c5a1ea | ||
![]() |
c4b7440bc0 | ||
![]() |
7d281401fd | ||
![]() |
23c7716bbb | ||
![]() |
98f0333110 | ||
![]() |
7907014ed7 |
267
CMakeLists.txt
267
CMakeLists.txt
@@ -200,8 +200,7 @@ mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a secur
|
||||
set(WITH_PYTHON_SECURITY ON CACHE BOOL "ON" FORCE) # temp force on.
|
||||
|
||||
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
|
||||
mark_as_advanced(WITH_PYTHON_SAFETY)
|
||||
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES (or CMAKE_INSTALL_PREFIX if WITH_INSTALL_PORTABLE is enabled)." OFF)
|
||||
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
|
||||
if(APPLE)
|
||||
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
|
||||
endif()
|
||||
@@ -261,10 +260,6 @@ endif()
|
||||
# (unix defaults to System OpenJPEG On)
|
||||
option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
|
||||
endif()
|
||||
|
||||
|
||||
# Modifiers
|
||||
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
|
||||
@@ -313,9 +308,6 @@ endif()
|
||||
# Compression
|
||||
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
|
||||
option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
|
||||
if(UNIX AND NOT APPLE)
|
||||
option(WITH_SYSTEM_LZO "Use the system LZO library" OFF)
|
||||
endif()
|
||||
|
||||
# Camera/motion tracking
|
||||
option(WITH_LIBMV "Enable libmv structure from motion library" ON)
|
||||
@@ -326,8 +318,8 @@ mark_as_advanced(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
|
||||
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
||||
|
||||
# Misc
|
||||
if(WIN32)
|
||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
|
||||
if (WIN32)
|
||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME)" ON)
|
||||
endif()
|
||||
option(WITH_INPUT_NDOF "Enable NDOF input devices (SpaceNavigator and friends)" ${_init_INPUT_NDOF})
|
||||
option(WITH_RAYOPTIMIZATION "Enable use of SIMD (SSE) optimizations for the raytracer" ON)
|
||||
@@ -377,7 +369,7 @@ endif()
|
||||
mark_as_advanced(LLVM_STATIC)
|
||||
|
||||
# disable for now, but plan to support on all platforms eventually
|
||||
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON)
|
||||
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
|
||||
mark_as_advanced(WITH_MEM_JEMALLOC)
|
||||
|
||||
# currently only used for BLI_mempool
|
||||
@@ -411,7 +403,6 @@ option(WITH_GL_EGL "Use the EGL OpenGL system library instead of th
|
||||
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
|
||||
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
|
||||
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
|
||||
option(WITH_GPU_DEBUG "Create a debug OpenGL context (allows inserting custom messages and getting notifications for bad GL use)" OFF)
|
||||
|
||||
mark_as_advanced(
|
||||
WITH_GLEW_MX
|
||||
@@ -420,7 +411,6 @@ mark_as_advanced(
|
||||
WITH_GL_PROFILE_COMPAT
|
||||
WITH_GL_PROFILE_CORE
|
||||
WITH_GL_PROFILE_ES20
|
||||
WITH_GPU_DEBUG
|
||||
)
|
||||
|
||||
if(WITH_GL_PROFILE_COMPAT)
|
||||
@@ -444,10 +434,6 @@ if(MSVC)
|
||||
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
|
||||
endif()
|
||||
|
||||
# Experimental support of C++11
|
||||
option(WITH_CPP11 "Build with C++11 standard enabled, for development use only!" OFF)
|
||||
mark_as_advanced(WITH_CPP11)
|
||||
|
||||
# avoid using again
|
||||
option_defaults_clear()
|
||||
|
||||
@@ -674,7 +660,6 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
|
||||
set(WITH_X11_XINPUT OFF)
|
||||
set(WITH_X11_XF86VMODE OFF)
|
||||
set(WITH_GHOST_XDND OFF)
|
||||
set(WITH_INPUT_IME OFF)
|
||||
endif()
|
||||
|
||||
if(WITH_CPU_SSE)
|
||||
@@ -809,21 +794,6 @@ if(UNIX AND NOT APPLE)
|
||||
find_package_wrapper(ZLIB REQUIRED)
|
||||
find_package_wrapper(Freetype REQUIRED)
|
||||
|
||||
if(WITH_LZO AND WITH_SYSTEM_LZO)
|
||||
find_package_wrapper(LZO)
|
||||
if(NOT LZO_FOUND)
|
||||
message(FATAL_ERROR "Failed finding system LZO version!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_SYSTEM_EIGEN3)
|
||||
find_package_wrapper(Eigen3)
|
||||
if(NOT EIGEN3_FOUND)
|
||||
message(FATAL_ERROR "Failed finding system Eigen3 version!")
|
||||
endif()
|
||||
endif()
|
||||
# else values are set below for all platforms
|
||||
|
||||
if(WITH_PYTHON)
|
||||
# No way to set py34. remove for now.
|
||||
# find_package(PythonLibs)
|
||||
@@ -868,21 +838,17 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
if(WITH_SDL)
|
||||
if(WITH_SDL_DYNLOAD)
|
||||
set(SDLMAIN_LIBRARY)
|
||||
set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2")
|
||||
set(SDL_LIBRARY)
|
||||
set(SDL_LIBRARY_TEMP)
|
||||
else()
|
||||
find_package_wrapper(SDL2)
|
||||
if(SDL2_FOUND)
|
||||
# Use same names for both versions of SDL until we move to 2.x.
|
||||
set(SDL_INCLUDE_DIR "${SDL2_INCLUDE_DIR}")
|
||||
set(SDL_LIBRARY "${SDL2_LIBRARY}")
|
||||
set(SDL_FOUND "${SDL2_FOUND}")
|
||||
else()
|
||||
find_package_wrapper(SDL)
|
||||
endif()
|
||||
find_package_wrapper(SDL)
|
||||
mark_as_advanced(
|
||||
SDLMAIN_LIBRARY
|
||||
SDL_INCLUDE_DIR
|
||||
SDL_LIBRARY
|
||||
SDL_LIBRARY_TEMP
|
||||
)
|
||||
# unset(SDLMAIN_LIBRARY CACHE)
|
||||
if(NOT SDL_FOUND)
|
||||
@@ -960,24 +926,6 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_OSL)
|
||||
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
||||
if(NOT OSL_ROOT)
|
||||
set(OSL_ROOT ${CYCLES_OSL})
|
||||
endif()
|
||||
find_package_wrapper(OpenShadingLanguage)
|
||||
if(OSL_FOUND)
|
||||
if(${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6")
|
||||
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
|
||||
# otherwise LLVM is missing the osl_allocate_closure_component function
|
||||
set(OSL_LIBRARIES ${OSL_OSLCOMP_LIBRARY} -Wl,--whole-archive ${OSL_OSLEXEC_LIBRARY} -Wl,--no-whole-archive ${OSL_OSLQUERY_LIBRARY})
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "OSL not found, disabling it from Cycles")
|
||||
set(WITH_CYCLES_OSL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_BOOST)
|
||||
# uses in build instructions to override include and library variables
|
||||
if(NOT BOOST_CUSTOM)
|
||||
@@ -986,12 +934,6 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
set(__boost_packages filesystem regex system thread date_time)
|
||||
if(WITH_CYCLES_OSL)
|
||||
if(NOT (${OSL_LIBRARY_VERSION_MAJOR} EQUAL "1" AND ${OSL_LIBRARY_VERSION_MINOR} LESS "6"))
|
||||
list(APPEND __boost_packages wave)
|
||||
else()
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_INTERNATIONAL)
|
||||
list(APPEND __boost_packages locale)
|
||||
endif()
|
||||
@@ -1021,12 +963,6 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
if(WITH_OPENIMAGEIO)
|
||||
find_package_wrapper(OpenImageIO)
|
||||
if(NOT OPENIMAGEIO_PUGIXML_FOUND AND WITH_CYCLES_STANDALONE)
|
||||
find_package_wrapper(PugiXML)
|
||||
else()
|
||||
set(PUGIXML_INCLUDE_DIR "${OPENIMAGEIO_INCLUDE_DIR/OpenImageIO}")
|
||||
set(PUGIXML_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ZLIB_LIBRARIES} ${BOOST_LIBRARIES})
|
||||
set(OPENIMAGEIO_LIBPATH) # TODO, remove and reference the absolute path everywhere
|
||||
@@ -1060,18 +996,18 @@ if(UNIX AND NOT APPLE)
|
||||
|
||||
# XXX Maybe most of this section should go into an llvm module?
|
||||
if(WITH_LLVM)
|
||||
# Set llvm version if not specified
|
||||
if(NOT LLVM_VERSION)
|
||||
set(LLVM_VERSION "3.0")
|
||||
endif()
|
||||
|
||||
if(LLVM_ROOT_DIR)
|
||||
if(NOT DEFINED LLVM_VERSION)
|
||||
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
|
||||
endif()
|
||||
if(LLVM_DIRECTORY)
|
||||
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
|
||||
if(NOT LLVM_CONFIG)
|
||||
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
|
||||
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
|
||||
endif()
|
||||
else()
|
||||
if(NOT DEFINED LLVM_VERSION)
|
||||
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
|
||||
endif()
|
||||
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
|
||||
if(NOT LLVM_CONFIG)
|
||||
find_program(LLVM_CONFIG llvm-config)
|
||||
endif()
|
||||
@@ -1083,11 +1019,11 @@ if(UNIX AND NOT APPLE)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
|
||||
endif()
|
||||
if(NOT DEFINED LLVM_ROOT_DIR)
|
||||
if(NOT DEFINED LLVM_DIRECTORY)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --prefix
|
||||
OUTPUT_VARIABLE LLVM_ROOT_DIR
|
||||
OUTPUT_VARIABLE LLVM_DIRECTORY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
|
||||
set(LLVM_DIRECTORY ${LLVM_DIRECTORY} CACHE PATH "Path to the LLVM installation")
|
||||
endif()
|
||||
if(NOT DEFINED LLVM_LIBPATH)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libdir
|
||||
@@ -1108,7 +1044,7 @@ if(UNIX AND NOT APPLE)
|
||||
endif()
|
||||
|
||||
|
||||
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
|
||||
if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIBPATH)
|
||||
if(LLVM_STATIC)
|
||||
# if static LLVM libraries were requested, use llvm-config to generate
|
||||
# the list of what libraries we need, and substitute that in the right
|
||||
@@ -1129,13 +1065,33 @@ if(UNIX AND NOT APPLE)
|
||||
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/source/creator/blender.map")
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES_OSL)
|
||||
set(CYCLES_OSL ${LIBDIR}/osl CACHE PATH "Path to OpenShadingLanguage installation")
|
||||
|
||||
message(STATUS "CYCLES_OSL = ${CYCLES_OSL}")
|
||||
|
||||
find_library(OSL_LIB_EXEC NAMES oslexec PATHS ${CYCLES_OSL}/lib)
|
||||
find_library(OSL_LIB_COMP NAMES oslcomp PATHS ${CYCLES_OSL}/lib)
|
||||
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
|
||||
# Note: --whole-archive is needed to force loading of all symbols in liboslexec,
|
||||
# otherwise LLVM is missing the osl_allocate_closure_component function
|
||||
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -Wl,--whole-archive ${OSL_LIB_EXEC} -Wl,--no-whole-archive ${OSL_LIB_QUERY})
|
||||
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
set(WITH_CYCLES_OSL OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
|
||||
list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT})
|
||||
# used by other platforms
|
||||
set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
if(CMAKE_DL_LIBS)
|
||||
list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS})
|
||||
@@ -1196,11 +1152,7 @@ elseif(WIN32)
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp)
|
||||
|
||||
if(WITH_INPUT_IME)
|
||||
list(APPEND PLATFORM_LINKLIBS imm32)
|
||||
endif()
|
||||
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi imm32)
|
||||
|
||||
add_definitions(
|
||||
-D_CRT_NONSTDC_NO_DEPRECATE
|
||||
@@ -1285,8 +1237,8 @@ elseif(WIN32)
|
||||
|
||||
find_package(png)
|
||||
if(NOT PNG_FOUND)
|
||||
message(WARNING "Using HARDCODED libpng locations")
|
||||
set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include)
|
||||
message(WARNING "Using HARDCODED libpng locations")
|
||||
set(PNG_LIBRARIES libpng)
|
||||
set(PNG "${LIBDIR}/png")
|
||||
set(PNG_INCLUDE_DIRS "${PNG}/include")
|
||||
@@ -1373,19 +1325,19 @@ elseif(WIN32)
|
||||
set(OPENEXR_VERSION "2.1")
|
||||
find_package(OPENEXR REQUIRED)
|
||||
if(NOT OPENEXR_FOUND)
|
||||
message(WARNING "Using HARDCODED OpenEXR locations")
|
||||
set(OPENEXR ${LIBDIR}/openexr)
|
||||
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
||||
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
|
||||
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
set(OPENEXR_LIBRARIES
|
||||
${OPENEXR_LIBPATH}/Iex-2_2.lib
|
||||
${OPENEXR_LIBPATH}/Half.lib
|
||||
${OPENEXR_LIBPATH}/IlmImf-2_2.lib
|
||||
${OPENEXR_LIBPATH}/Imath-2_2.lib
|
||||
${OPENEXR_LIBPATH}/IlmThread-2_2.lib
|
||||
)
|
||||
endif()
|
||||
message(WARNING "Using HARDCODED OpenEXR locations")
|
||||
set(OPENEXR ${LIBDIR}/openexr)
|
||||
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
|
||||
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
|
||||
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
|
||||
set(OPENEXR_LIBRARIES
|
||||
${OPENEXR_LIBPATH}/Iex-2_1.lib
|
||||
${OPENEXR_LIBPATH}/Half.lib
|
||||
${OPENEXR_LIBPATH}/IlmImf-2_1.lib
|
||||
${OPENEXR_LIBPATH}/Imath-2_1.lib
|
||||
${OPENEXR_LIBPATH}/IlmThread-2_1.lib
|
||||
)
|
||||
endif(NOT OPENEXR_FOUND)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
@@ -1425,10 +1377,10 @@ elseif(WIN32)
|
||||
if(WITH_BOOST)
|
||||
if(WITH_CYCLES_OSL)
|
||||
set(boost_extra_libs wave)
|
||||
endif()
|
||||
endif(WITH_CYCLES_OSL)
|
||||
if(WITH_INTERNATIONAL)
|
||||
list(APPEND boost_extra_libs locale)
|
||||
endif()
|
||||
endif(WITH_INTERNATIONAL)
|
||||
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
|
||||
set(Boost_USE_MULTITHREADED ON) # suffix -mt
|
||||
set(Boost_USE_STATIC_LIBS ON) # suffix -s
|
||||
@@ -1481,21 +1433,20 @@ elseif(WIN32)
|
||||
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
|
||||
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
|
||||
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
|
||||
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
|
||||
add_definitions(-DOIIO_STATIC_BUILD)
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
|
||||
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib)
|
||||
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
|
||||
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_DIRECTORY}/lib/*.lib)
|
||||
|
||||
if(EXISTS ${LLVM_ROOT_DIR}/debug/lib)
|
||||
if(EXISTS ${LLVM_DIRECTORY}/debug/lib)
|
||||
foreach(LLVM_OPTIMIZED_LIB ${LLVM_LIBRARY_OPTIMIZED})
|
||||
get_filename_component(LIBNAME ${LLVM_OPTIMIZED_LIB} ABSOLUTE)
|
||||
list(APPEND LLVM_LIBS optimized ${LIBNAME})
|
||||
endforeach(LLVM_OPTIMIZED_LIB)
|
||||
|
||||
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_ROOT_DIR}/debug/lib/*.lib)
|
||||
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_DIRECTORY}/debug/lib/*.lib)
|
||||
|
||||
foreach(LLVM_DEBUG_LIB ${LLVM_LIBRARY_DEBUG})
|
||||
get_filename_component(LIBNAME ${LLVM_DEBUG_LIB} ABSOLUTE)
|
||||
@@ -1530,13 +1481,6 @@ elseif(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL2)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
endif()
|
||||
|
||||
# used in many places so include globally, like OpenGL
|
||||
blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}")
|
||||
|
||||
@@ -1554,12 +1498,7 @@ elseif(WIN32)
|
||||
|
||||
if(WITH_MINGW64)
|
||||
message(STATUS "Compiling for 64 bit with MinGW-w64.")
|
||||
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||
if(GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64_gcc49)
|
||||
else()
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
|
||||
endif()
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
|
||||
else()
|
||||
message(STATUS "Compiling for 32 bit with MinGW-w32.")
|
||||
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
|
||||
@@ -1569,12 +1508,7 @@ elseif(WIN32)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -ldbghelp)
|
||||
|
||||
if(WITH_INPUT_IME)
|
||||
list(APPEND PLATFORM_LINKLIBS -limm32)
|
||||
endif()
|
||||
|
||||
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -limm32)
|
||||
set(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing")
|
||||
|
||||
if(WITH_MINGW64)
|
||||
@@ -1728,12 +1662,11 @@ elseif(WIN32)
|
||||
set(OPENIMAGEIO_LIBRARIES OpenImageIO)
|
||||
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib)
|
||||
set(OPENIMAGEIO_DEFINITIONS "")
|
||||
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
|
||||
set(LLVM_LIBPATH ${LLVM_ROOT_DIR}/lib)
|
||||
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
|
||||
set(LLVM_LIBPATH ${LLVM_DIRECTORY}/lib)
|
||||
# Explicitly set llvm lib order.
|
||||
#---- WARNING ON GCC ORDER OF LIBS IS IMPORTANT, DO NOT CHANGE! ---------
|
||||
set(LLVM_LIBRARY LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMAnalysis LLVMArchive
|
||||
@@ -1766,13 +1699,6 @@ elseif(WIN32)
|
||||
set(OPENCOLORIO_DEFINITIONS)
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
endif()
|
||||
|
||||
set(PLATFORM_LINKFLAGS "-Xlinker --stack=2097152")
|
||||
|
||||
## DISABLE - causes linking errors
|
||||
@@ -1804,6 +1730,13 @@ elseif(WIN32)
|
||||
set(SNDFILE_LIBPATH ${SNDFILE}/lib) # TODO, deprecate
|
||||
endif()
|
||||
|
||||
if(WITH_SDL)
|
||||
set(SDL ${LIBDIR}/sdl)
|
||||
set(SDL_INCLUDE_DIR ${SDL}/include)
|
||||
set(SDL_LIBRARY SDL2)
|
||||
set(SDL_LIBPATH ${SDL}/lib)
|
||||
endif()
|
||||
|
||||
if(WITH_RAYOPTIMIZATION AND SUPPORT_SSE_BUILD)
|
||||
add_definitions(-D__SSE__ -D__MMX__)
|
||||
endif()
|
||||
@@ -1818,10 +1751,10 @@ elseif(WIN32)
|
||||
find_library(OSL_LIB_COMP_DEBUG NAMES oslcomp_d PATHS ${CYCLES_OSL}/lib)
|
||||
find_library(OSL_LIB_QUERY_DEBUG NAMES oslquery_d PATHS ${CYCLES_OSL}/lib)
|
||||
list(APPEND OSL_LIBRARIES optimized ${OSL_LIB_COMP} optimized ${OSL_LIB_EXEC} optimized ${OSL_LIB_QUERY} debug ${OSL_LIB_EXEC_DEBUG} debug ${OSL_LIB_COMP_DEBUG} debug ${OSL_LIB_QUERY_DEBUG})
|
||||
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
|
||||
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
@@ -2057,7 +1990,6 @@ elseif(APPLE)
|
||||
set(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO}/lib/libOpenImageIO.a ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARY} ${OPENEXR_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
set(OPENIMAGEIO_LIBPATH ${OPENIMAGEIO}/lib ${JPEG_LIBPATH} ${PNG_LIBPATH} ${TIFF_LIBPATH} ${OPENEXR_LIBPATH} ${ZLIB_LIBPATH})
|
||||
set(OPENIMAGEIO_DEFINITIONS "-DOIIO_STATIC_BUILD")
|
||||
set(OPENIMAGEIO_IDIFF "${LIBDIR}/openimageio/bin/idiff")
|
||||
endif()
|
||||
|
||||
if(WITH_OPENCOLORIO)
|
||||
@@ -2068,10 +2000,10 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(WITH_LLVM)
|
||||
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
|
||||
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
|
||||
set(LLVM_VERSION "3.4" CACHE STRING "Version of LLVM to use")
|
||||
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
|
||||
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
|
||||
if(EXISTS "${LLVM_DIRECTORY}/bin/llvm-config")
|
||||
set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
|
||||
else()
|
||||
set(LLVM_CONFIG llvm-config)
|
||||
endif()
|
||||
@@ -2079,7 +2011,7 @@ elseif(APPLE)
|
||||
OUTPUT_VARIABLE LLVM_VERSION
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --prefix
|
||||
OUTPUT_VARIABLE LLVM_ROOT_DIR
|
||||
OUTPUT_VARIABLE LLVM_DIRECTORY
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${LLVM_CONFIG} --libdir
|
||||
OUTPUT_VARIABLE LLVM_LIBPATH
|
||||
@@ -2088,7 +2020,7 @@ elseif(APPLE)
|
||||
NAMES LLVMAnalysis # first of a whole bunch of libs to get
|
||||
PATHS ${LLVM_LIBPATH})
|
||||
|
||||
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
|
||||
if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIBPATH)
|
||||
if(LLVM_STATIC)
|
||||
# if static LLVM libraries were requested, use llvm-config to generate
|
||||
# the list of what libraries we need, and substitute that in the right
|
||||
@@ -2113,10 +2045,10 @@ elseif(APPLE)
|
||||
find_library(OSL_LIB_QUERY NAMES oslquery PATHS ${CYCLES_OSL}/lib)
|
||||
# WARNING! depends on correct order of OSL libs linking
|
||||
list(APPEND OSL_LIBRARIES ${OSL_LIB_COMP} -force_load ${OSL_LIB_EXEC} ${OSL_LIB_QUERY})
|
||||
find_path(OSL_INCLUDE_DIR OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_path(OSL_INCLUDES OSL/oslclosure.h PATHS ${CYCLES_OSL}/include)
|
||||
find_program(OSL_COMPILER NAMES oslc PATHS ${CYCLES_OSL}/bin)
|
||||
|
||||
if(OSL_INCLUDE_DIR AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
if(OSL_INCLUDES AND OSL_LIBRARIES AND OSL_COMPILER)
|
||||
set(OSL_FOUND TRUE)
|
||||
else()
|
||||
message(STATUS "OSL not found")
|
||||
@@ -2259,9 +2191,6 @@ if(WITH_IMAGE_REDCODE)
|
||||
set(REDCODE_INC ${REDCODE})
|
||||
endif()
|
||||
|
||||
if(NOT WITH_SYSTEM_EIGEN3)
|
||||
set(EIGEN3_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/Eigen3)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenGL.
|
||||
@@ -2383,10 +2312,6 @@ if(WITH_GL_EGL)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_EGL)
|
||||
endif()
|
||||
|
||||
if(WITH_GPU_DEBUG)
|
||||
list(APPEND GL_DEFINITIONS -DWITH_GPU_DEBUG)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure OpenMP.
|
||||
if(WITH_OPENMP)
|
||||
@@ -2550,15 +2475,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_RETURN_TYPE -Werror=return-type)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_POINTER_ARITH -Wpointer-arith)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_PARAMETER -Wunused-parameter)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)
|
||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
|
||||
|
||||
# gcc 4.2 gives annoying warnings on every file with this
|
||||
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
|
||||
@@ -2692,16 +2608,6 @@ if(WITH_PYTHON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CPP11)
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
elseif(MSVC12)
|
||||
# Nothing special is needed, C++11 features are available by default.
|
||||
else()
|
||||
message(FATAL_ERROR "Compiler ${CMAKE_C_COMPILER_ID} is not supported for C++11 build yet")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Include warnings first, so its possible to disable them with user defined flags
|
||||
# eg: -Wno-uninitialized
|
||||
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
|
||||
@@ -2714,12 +2620,12 @@ mark_as_advanced(
|
||||
OSL_COMPILER
|
||||
OSL_LIB_COMP
|
||||
OSL_LIB_QUERY
|
||||
OSL_INCLUDE_DIR
|
||||
OSL_INCLUDES
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
LLVM_CONFIG
|
||||
LLVM_ROOT_DIR
|
||||
LLVM_DIRECTORY
|
||||
LLVM_LIBRARY
|
||||
LLVM_VERSION
|
||||
)
|
||||
@@ -2888,7 +2794,6 @@ if(FIRST_RUN)
|
||||
info_cfg_option(WITH_GL_PROFILE_COMPAT)
|
||||
info_cfg_option(WITH_GL_PROFILE_CORE)
|
||||
info_cfg_option(WITH_GL_PROFILE_ES20)
|
||||
info_cfg_option(WITH_GPU_DEBUG)
|
||||
if(WIN32)
|
||||
info_cfg_option(WITH_GL_ANGLE)
|
||||
endif()
|
||||
|
80
GNUmakefile
80
GNUmakefile
@@ -65,7 +65,7 @@ ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
|
||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
|
||||
endif
|
||||
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
|
||||
BUILD_DIR:=$(BUILD_DIR)_headless
|
||||
BUILD_DIR:=$(BUILD_DIR)_bpy
|
||||
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
|
||||
endif
|
||||
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
|
||||
@@ -113,7 +113,7 @@ endif
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Build Blender
|
||||
all: FORCE
|
||||
all:
|
||||
@echo
|
||||
@echo Configuring Blender ...
|
||||
|
||||
@@ -142,13 +142,13 @@ bpy: all
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Configuration (save some cd'ing around)
|
||||
config: FORCE
|
||||
config:
|
||||
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Help for build targets
|
||||
help: FORCE
|
||||
help:
|
||||
@echo ""
|
||||
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
|
||||
@echo " * debug - build a debug binary"
|
||||
@@ -171,7 +171,7 @@ help: FORCE
|
||||
@echo ""
|
||||
@echo "Package Targets"
|
||||
@echo " * package_debian - build a debian package"
|
||||
@echo " * package_pacman - build an arch linux pacman package"
|
||||
@echo " * package_pacman - build an arch linux pacmanpackage"
|
||||
@echo " * package_archive - build an archive package"
|
||||
@echo ""
|
||||
@echo "Testing Targets (not associated with building blender)"
|
||||
@@ -214,13 +214,13 @@ help: FORCE
|
||||
# -----------------------------------------------------------------------------
|
||||
# Packages
|
||||
#
|
||||
package_debian: FORCE
|
||||
package_debian:
|
||||
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
|
||||
|
||||
package_pacman: FORCE
|
||||
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
|
||||
package_pacman:
|
||||
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
|
||||
|
||||
package_archive: FORCE
|
||||
package_archive:
|
||||
make -C "$(BUILD_DIR)" -s package_archive
|
||||
@echo archive in "$(BUILD_DIR)/release"
|
||||
|
||||
@@ -228,24 +228,24 @@ package_archive: FORCE
|
||||
# -----------------------------------------------------------------------------
|
||||
# Tests
|
||||
#
|
||||
test: FORCE
|
||||
test:
|
||||
cd $(BUILD_DIR) ; ctest . --output-on-failure
|
||||
|
||||
# run pep8 check check on scripts we distribute.
|
||||
test_pep8: FORCE
|
||||
test_pep8:
|
||||
python3 tests/python/pep8.py > test_pep8.log 2>&1
|
||||
@echo "written: test_pep8.log"
|
||||
|
||||
# run some checks on our cmakefiles.
|
||||
test_cmake: FORCE
|
||||
test_cmake:
|
||||
python3 build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
|
||||
@echo "written: test_cmake_consistency.log"
|
||||
|
||||
# run deprecation tests, see if we have anything to remove.
|
||||
test_deprecated: FORCE
|
||||
test_deprecated:
|
||||
python3 tests/check_deprecated.py
|
||||
|
||||
test_style_c: FORCE
|
||||
test_style_c:
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
@@ -253,7 +253,7 @@ test_style_c: FORCE
|
||||
"$(BLENDER_DIR)/source/creator" \
|
||||
--no-length-check
|
||||
|
||||
test_style_c_qtc: FORCE
|
||||
test_style_c_qtc:
|
||||
# run our own checks on C/C++ style
|
||||
USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
@@ -266,7 +266,7 @@ test_style_c_qtc: FORCE
|
||||
@echo "written: test_style.tasks"
|
||||
|
||||
|
||||
test_style_osl: FORCE
|
||||
test_style_osl:
|
||||
# run our own checks on C/C++ style
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
|
||||
@@ -274,7 +274,7 @@ test_style_osl: FORCE
|
||||
"$(BLENDER_DIR)/release/scripts/templates_osl"
|
||||
|
||||
|
||||
test_style_osl_qtc: FORCE
|
||||
test_style_osl_qtc:
|
||||
# run our own checks on C/C++ style
|
||||
USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
@@ -289,13 +289,13 @@ test_style_osl_qtc: FORCE
|
||||
# Project Files
|
||||
#
|
||||
|
||||
project_qtcreator: FORCE
|
||||
project_qtcreator:
|
||||
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
|
||||
|
||||
project_netbeans: FORCE
|
||||
project_netbeans:
|
||||
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
|
||||
|
||||
project_eclipse: FORCE
|
||||
project_eclipse:
|
||||
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
|
||||
|
||||
|
||||
@@ -303,40 +303,40 @@ project_eclipse: FORCE
|
||||
# Static Checking
|
||||
#
|
||||
|
||||
check_cppcheck: FORCE
|
||||
check_cppcheck:
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
|
||||
"$(BLENDER_DIR)/check_cppcheck.txt"
|
||||
@echo "written: check_cppcheck.txt"
|
||||
|
||||
check_clang_array: FORCE
|
||||
check_clang_array:
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
|
||||
|
||||
check_splint: FORCE
|
||||
check_splint:
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
|
||||
|
||||
check_sparse: FORCE
|
||||
check_sparse:
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
|
||||
|
||||
check_smatch: FORCE
|
||||
check_smatch:
|
||||
$(CMAKE_CONFIG)
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
|
||||
|
||||
check_spelling_py: FORCE
|
||||
check_spelling_py:
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
"$(BLENDER_DIR)/release/scripts"
|
||||
|
||||
check_spelling_c: FORCE
|
||||
check_spelling_c:
|
||||
cd "$(BUILD_DIR)" ; \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
@@ -345,7 +345,7 @@ check_spelling_c: FORCE
|
||||
"$(BLENDER_DIR)/intern/guardedalloc" \
|
||||
"$(BLENDER_DIR)/intern/ghost" \
|
||||
|
||||
check_spelling_c_qtc: FORCE
|
||||
check_spelling_c_qtc:
|
||||
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
@@ -356,13 +356,13 @@ check_spelling_c_qtc: FORCE
|
||||
> \
|
||||
"$(BLENDER_DIR)/check_spelling_c.tasks"
|
||||
|
||||
check_spelling_osl: FORCE
|
||||
check_spelling_osl:
|
||||
cd "$(BUILD_DIR)" ;\
|
||||
PYTHONIOENCODING=utf_8 python3 \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
|
||||
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
|
||||
|
||||
check_descriptions: FORCE
|
||||
check_descriptions:
|
||||
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \
|
||||
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
|
||||
|
||||
@@ -370,14 +370,14 @@ check_descriptions: FORCE
|
||||
# Utilities
|
||||
#
|
||||
|
||||
tgz: FORCE
|
||||
tgz:
|
||||
./build_files/utils/build_tgz.sh
|
||||
|
||||
icons: FORCE
|
||||
icons:
|
||||
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
|
||||
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
|
||||
|
||||
update: FORCE
|
||||
update:
|
||||
if [ -d "../lib" ]; then \
|
||||
svn update ../lib/* ; \
|
||||
fi
|
||||
@@ -390,23 +390,23 @@ update: FORCE
|
||||
#
|
||||
|
||||
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
|
||||
doc_py: FORCE
|
||||
doc_py:
|
||||
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
|
||||
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
|
||||
|
||||
doc_doxy: FORCE
|
||||
doc_doxy:
|
||||
cd doc/doxygen; doxygen Doxyfile
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
|
||||
|
||||
doc_dna: FORCE
|
||||
doc_dna:
|
||||
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
|
||||
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
|
||||
|
||||
doc_man: FORCE
|
||||
doc_man:
|
||||
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
|
||||
|
||||
help_features: FORCE
|
||||
help_features:
|
||||
@python3 -c \
|
||||
"import re; \
|
||||
print('\n'.join([ \
|
||||
@@ -417,9 +417,7 @@ help_features: FORCE
|
||||
if w.startswith('WITH_')]))" | uniq
|
||||
|
||||
|
||||
clean: FORCE
|
||||
clean:
|
||||
$(MAKE) -C "$(BUILD_DIR)" clean
|
||||
|
||||
.PHONY: all
|
||||
|
||||
FORCE:
|
||||
|
71
SConstruct
71
SConstruct
@@ -266,7 +266,6 @@ if 'blenderlite' in B.targets:
|
||||
target_env_defs['WITH_BF_BOOLEAN'] = False
|
||||
target_env_defs['WITH_BF_REMESH'] = False
|
||||
target_env_defs['WITH_BF_PYTHON'] = False
|
||||
target_env_defs['WITH_BF_IME'] = False
|
||||
target_env_defs['WITH_BF_3DMOUSE'] = False
|
||||
target_env_defs['WITH_BF_LIBMV'] = False
|
||||
target_env_defs['WITH_BF_FREESTYLE'] = False
|
||||
@@ -480,13 +479,6 @@ if env['WITH_BF_OPENMP'] == 1:
|
||||
else:
|
||||
env.Append(CCFLAGS=['-fopenmp'])
|
||||
|
||||
if env['WITH_BF_CPP11']:
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
# Nothing special is needed, C++11 features are available by default.
|
||||
pass
|
||||
else:
|
||||
env['CXXFLAGS'].append('-std=c++11')
|
||||
|
||||
#check for additional debug libnames
|
||||
|
||||
if env.has_key('BF_DEBUG_LIBS'):
|
||||
@@ -768,15 +760,6 @@ if B.targets != ['cudakernels']:
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex_world.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_vert.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_lib.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl")
|
||||
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_vert.glsl")
|
||||
data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl")
|
||||
|
||||
# --- blender ---
|
||||
@@ -871,21 +854,19 @@ B.init_lib_dict()
|
||||
|
||||
##### END SETUP ##########
|
||||
|
||||
## Auto-configuration run-time tests
|
||||
if B.targets != ['cudakernels']:
|
||||
# Put all auto configuration run-time tests here
|
||||
|
||||
from FindSharedPtr import FindSharedPtr
|
||||
from FindUnorderedMap import FindUnorderedMap
|
||||
from FindSharedPtr import FindSharedPtr
|
||||
from FindUnorderedMap import FindUnorderedMap
|
||||
|
||||
conf = Configure(env)
|
||||
old_linkflags = conf.env['LINKFLAGS']
|
||||
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
|
||||
|
||||
# Put all tests here
|
||||
FindSharedPtr(conf)
|
||||
FindUnorderedMap(conf)
|
||||
|
||||
conf.env['LINKFLAGS'] = old_linkflags
|
||||
env = conf.Finish()
|
||||
conf = Configure(env)
|
||||
old_linkflags = conf.env['LINKFLAGS']
|
||||
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
|
||||
FindSharedPtr(conf)
|
||||
FindUnorderedMap(conf)
|
||||
conf.env['LINKFLAGS'] = old_linkflags
|
||||
env = conf.Finish()
|
||||
|
||||
# End of auto configuration
|
||||
|
||||
@@ -1028,7 +1009,6 @@ if env['OURPLATFORM']!='darwin':
|
||||
source.append('intern/cycles/util/util_color.h')
|
||||
source.append('intern/cycles/util/util_half.h')
|
||||
source.append('intern/cycles/util/util_math.h')
|
||||
source.append('intern/cycles/util/util_math_fast.h')
|
||||
source.append('intern/cycles/util/util_transform.h')
|
||||
source.append('intern/cycles/util/util_types.h')
|
||||
scriptinstall.append(env.Install(dir=dir,source=source))
|
||||
@@ -1179,37 +1159,9 @@ if env['OURPLATFORM']=='linuxcross':
|
||||
textlist = []
|
||||
texttargetlist = []
|
||||
for tp, tn, tf in os.walk('release/text'):
|
||||
tf.remove("readme.html")
|
||||
for f in tf:
|
||||
textlist.append(tp+os.sep+f)
|
||||
|
||||
def readme_version_patch():
|
||||
readme_src = "release/text/readme.html"
|
||||
readme_dst = os.path.abspath(os.path.normpath(os.path.join(env['BF_BUILDDIR'], "readme.html")))
|
||||
|
||||
if not os.path.exists(readme_dst) or (os.path.getmtime(readme_dst) < os.path.getmtime(readme_src)):
|
||||
f = open(readme_src, "r")
|
||||
data = f.read()
|
||||
f.close()
|
||||
|
||||
data = data.replace("BLENDER_VERSION", VERSION)
|
||||
f = open(readme_dst, "w")
|
||||
f.write(data)
|
||||
f.close()
|
||||
|
||||
textlist.append(readme_dst)
|
||||
|
||||
readme_version_patch()
|
||||
del readme_version_patch
|
||||
|
||||
|
||||
'''Command(
|
||||
"release/text/readme.html"
|
||||
|
||||
)
|
||||
Command("file.out", "file.in", Copy(env['BF_INSTALLDIR'], "release/text/readme.html"))
|
||||
'''
|
||||
|
||||
# Font licenses
|
||||
textlist.append('release/datafiles/LICENSE-bfont.ttf.txt')
|
||||
if env['WITH_BF_INTERNATIONAL']:
|
||||
@@ -1255,6 +1207,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
|
||||
|
||||
if env['WITH_BF_OPENAL']:
|
||||
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
|
||||
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
|
||||
|
||||
if env['WITH_BF_SNDFILE']:
|
||||
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
|
||||
|
@@ -209,14 +209,14 @@ OCIO_VERSION_MIN="1.0"
|
||||
OCIO_FORCE_REBUILD=false
|
||||
OCIO_SKIP=false
|
||||
|
||||
OPENEXR_VERSION="2.2.0"
|
||||
OPENEXR_VERSION="2.1.0"
|
||||
OPENEXR_VERSION_MIN="2.0.1"
|
||||
ILMBASE_VERSION="2.2.0"
|
||||
ILMBASE_VERSION="2.1.0"
|
||||
OPENEXR_FORCE_REBUILD=false
|
||||
OPENEXR_SKIP=false
|
||||
_with_built_openexr=false
|
||||
|
||||
OIIO_VERSION="1.4.16"
|
||||
OIIO_VERSION="1.4.11"
|
||||
OIIO_VERSION_MIN="1.4.0"
|
||||
OIIO_FORCE_REBUILD=false
|
||||
OIIO_SKIP=false
|
||||
@@ -228,7 +228,7 @@ LLVM_FORCE_REBUILD=false
|
||||
LLVM_SKIP=false
|
||||
|
||||
# OSL needs to be compiled for now!
|
||||
OSL_VERSION="1.5.11"
|
||||
OSL_VERSION="1.5.0"
|
||||
OSL_VERSION_MIN=$OSL_VERSION
|
||||
OSL_FORCE_REBUILD=false
|
||||
OSL_SKIP=false
|
||||
@@ -485,29 +485,25 @@ BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION
|
||||
|
||||
OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
|
||||
|
||||
OPENEXR_USE_REPO=false
|
||||
OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
|
||||
OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
|
||||
OPENEXR_SOURCE_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
|
||||
#OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
|
||||
OPENEXR_SOURCE=( "https://github.com/mont29/openexr.git" )
|
||||
OPENEXR_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
|
||||
ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" )
|
||||
|
||||
OIIO_USE_REPO=false
|
||||
OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
|
||||
OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
|
||||
OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
|
||||
#OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
|
||||
OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio.git" )
|
||||
OIIO_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
|
||||
|
||||
LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
|
||||
LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
|
||||
OSL_USE_REPO=true
|
||||
#~ OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
|
||||
OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz" )
|
||||
#~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" )
|
||||
#~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" )
|
||||
#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
|
||||
#~ OSL_SOURCE_REPO_BRANCH="master"
|
||||
OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
|
||||
OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
|
||||
OSL_SOURCE_REPO_BRANCH="blender-fixes"
|
||||
#OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
|
||||
#OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage.git" )
|
||||
#OSL_SOURCE=( "https://github.com/mont29/OpenShadingLanguage.git" )
|
||||
#OSL_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
|
||||
#OSL_REPO_BRANCH="master"
|
||||
OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
|
||||
OSL_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
|
||||
OSL_REPO_BRANCH="blender-fixes"
|
||||
|
||||
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
|
||||
OPENCOLLADA_REPO_UID="18da7f4109a8eafaa290a33f5550501cc4c8bae8"
|
||||
@@ -983,7 +979,7 @@ clean_ILMBASE() {
|
||||
|
||||
compile_ILMBASE() {
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
ilmbase_magic=10
|
||||
ilmbase_magic=9
|
||||
_init_ilmbase
|
||||
|
||||
# Clean install if needed!
|
||||
@@ -1007,7 +1003,8 @@ compile_ILMBASE() {
|
||||
download ILMBASE_SOURCE[@] $_src.tar.gz
|
||||
|
||||
INFO "Unpacking ILMBase-$ILMBASE_VERSION"
|
||||
tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" -xf $_src.tar.gz
|
||||
tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
|
||||
fi
|
||||
|
||||
@@ -1023,7 +1020,6 @@ compile_ILMBASE() {
|
||||
cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
|
||||
cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
|
||||
|
||||
if file /bin/cp | grep -q '32-bit'; then
|
||||
cflags="-fPIC -m32 -march=i686"
|
||||
@@ -1096,28 +1092,24 @@ compile_OPENEXR() {
|
||||
INFO "Downloading OpenEXR-$OPENEXR_VERSION"
|
||||
mkdir -p $SRC
|
||||
|
||||
if [ $OPENEXR_USE_REPO == true ]; then
|
||||
git clone ${OPENEXR_SOURCE_REPO[0]} $_src
|
||||
else
|
||||
download OPENEXR_SOURCE[@] $_src.tar.gz
|
||||
INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
|
||||
tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" -xf $_src.tar.gz
|
||||
fi
|
||||
# download OPENEXR_SOURCE[@] $_src.tar.gz
|
||||
|
||||
# INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
|
||||
# tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" \
|
||||
# -xf $_src.tar.gz
|
||||
|
||||
git clone ${OPENEXR_SOURCE[0]} $_src
|
||||
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
|
||||
if [ $OPENEXR_USE_REPO == true ]; then
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull origin master
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OPENEXR_SOURCE_REPO_UID
|
||||
git reset --hard
|
||||
oiio_src_path="../OpenEXR"
|
||||
else
|
||||
oiio_src_path=".."
|
||||
fi
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull origin master
|
||||
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OPENEXR_REPO_UID
|
||||
git reset --hard
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
@@ -1131,7 +1123,6 @@ compile_OPENEXR() {
|
||||
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
|
||||
cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$_ilmbase_inst"
|
||||
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
|
||||
cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
|
||||
|
||||
if file /bin/cp | grep -q '32-bit'; then
|
||||
cflags="-fPIC -m32 -march=i686"
|
||||
@@ -1139,7 +1130,7 @@ compile_OPENEXR() {
|
||||
cflags="-fPIC"
|
||||
fi
|
||||
|
||||
cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" $oiio_src_path
|
||||
cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ../OpenEXR
|
||||
|
||||
make -j$THREADS && make install
|
||||
|
||||
@@ -1203,25 +1194,24 @@ compile_OIIO() {
|
||||
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
#download OIIO_SOURCE[@] "$_src.tar.gz"
|
||||
#
|
||||
#INFO "Unpacking OpenImageIO-$OIIO_VERSION"
|
||||
#tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" \
|
||||
#-xf $_src.tar.gz
|
||||
|
||||
git clone ${OIIO_SOURCE[0]} $_src
|
||||
|
||||
if [ $OIIO_USE_REPO == true ]; then
|
||||
git clone ${OIIO_SOURCE_REPO[0]} $_src
|
||||
else
|
||||
download OIIO_SOURCE[@] "$_src.tar.gz"
|
||||
INFO "Unpacking OpenImageIO-$OIIO_VERSION"
|
||||
tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" -xf $_src.tar.gz
|
||||
fi
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
|
||||
if [ $OIIO_USE_REPO == true ]; then
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull origin master
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OIIO_SOURCE_REPO_UID
|
||||
git reset --hard
|
||||
fi
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull origin master
|
||||
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OIIO_REPO_UID
|
||||
git reset --hard
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
@@ -1243,7 +1233,6 @@ compile_OIIO() {
|
||||
if [ $_with_built_openexr == true ]; then
|
||||
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
|
||||
cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr"
|
||||
INFO "ILMBASE_HOME=$INST/openexr"
|
||||
fi
|
||||
|
||||
# Optional tests and cmd tools
|
||||
@@ -1420,15 +1409,15 @@ clean_OSL() {
|
||||
|
||||
compile_OSL() {
|
||||
# To be changed each time we make edits that would modify the compiled result!
|
||||
osl_magic=17
|
||||
osl_magic=16
|
||||
_init_osl
|
||||
|
||||
# Clean install if needed!
|
||||
magic_compile_check osl-$OSL_VERSION $osl_magic
|
||||
#~ if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
|
||||
#~ rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
|
||||
#~ clean_OSL
|
||||
#~ fi
|
||||
if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
|
||||
rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically
|
||||
clean_OSL
|
||||
fi
|
||||
|
||||
if [ ! -d $_inst ]; then
|
||||
INFO "Building OpenShadingLanguage-$OSL_VERSION"
|
||||
@@ -1438,26 +1427,26 @@ compile_OSL() {
|
||||
if [ ! -d $_src ]; then
|
||||
mkdir -p $SRC
|
||||
|
||||
if [ $OSL_USE_REPO == true ]; then
|
||||
git clone ${OSL_SOURCE_REPO[0]} $_src
|
||||
else
|
||||
download OSL_SOURCE[@] "$_src.tar.gz"
|
||||
INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
|
||||
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
|
||||
-xf $_src.tar.gz
|
||||
fi
|
||||
#download OSL_SOURCE[@] "$_src.tar.gz"
|
||||
|
||||
#INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
|
||||
#tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
|
||||
#-xf $_src.tar.gz
|
||||
|
||||
git clone ${OSL_SOURCE[0]} $_src
|
||||
|
||||
fi
|
||||
|
||||
cd $_src
|
||||
|
||||
if [ $OSL_USE_REPO == true ]; then
|
||||
git remote set-url origin ${OSL_SOURCE_REPO[0]}
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull --no-edit -X theirs origin $OSL_SOURCE_REPO_BRANCH
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OSL_SOURCE_REPO_UID
|
||||
git reset --hard
|
||||
fi
|
||||
git remote set-url origin ${OSL_SOURCE[0]}
|
||||
|
||||
# XXX For now, always update from latest repo...
|
||||
git pull --no-edit -X theirs origin $OSL_GIT_BRANCH
|
||||
|
||||
# Stick to same rev as windows' libs...
|
||||
git checkout $OSL_REPO_UID
|
||||
git reset --hard
|
||||
|
||||
# Always refresh the whole build!
|
||||
if [ -d build ]; then
|
||||
@@ -1472,14 +1461,11 @@ compile_OSL() {
|
||||
cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
|
||||
cmake_d="$cmake_d -D BUILDSTATIC=OFF"
|
||||
|
||||
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
|
||||
cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
|
||||
|
||||
if [ $_with_built_openexr == true ]; then
|
||||
INFO "ILMBASE_HOME=$INST/openexr"
|
||||
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
|
||||
# XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
|
||||
cmake_d="$cmake_d -D ILMBASE_CUSTOM=ON"
|
||||
cmake_d="$cmake_d -D ILMBASE_CUSTOM_LIBRARIES='Half;Iex;Imath;IlmThread'"
|
||||
fi
|
||||
|
||||
if [ -d $INST/boost ]; then
|
||||
@@ -1493,7 +1479,7 @@ compile_OSL() {
|
||||
if [ ! -z $LLVM_VERSION_FOUND ]; then
|
||||
cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
|
||||
if [ -d $INST/llvm ]; then
|
||||
cmake_d="$cmake_d -D LLVM_ROOT_DIR=$INST/llvm"
|
||||
cmake_d="$cmake_d -D LLVM_DIRECTORY=$INST/llvm"
|
||||
cmake_d="$cmake_d -D LLVM_STATIC=ON"
|
||||
fi
|
||||
fi
|
||||
@@ -1992,7 +1978,7 @@ install_DEB() {
|
||||
if [ $? -eq 0 ]; then
|
||||
install_packages_DEB libboost-locale$boost_version-dev libboost-filesystem$boost_version-dev \
|
||||
libboost-regex$boost_version-dev libboost-system$boost_version-dev \
|
||||
libboost-thread$boost_version-dev libboost-wave$boost_version-dev
|
||||
libboost-thread$boost_version-dev
|
||||
clean_Boost
|
||||
else
|
||||
compile_Boost
|
||||
@@ -2997,7 +2983,7 @@ print_info() {
|
||||
_buildargs="$_buildargs $_1"
|
||||
fi
|
||||
if [ -d $INST/llvm ]; then
|
||||
_1="-D LLVM_ROOT_DIR=$INST/llvm"
|
||||
_1="-D LLVM_DIRECTORY=$INST/llvm"
|
||||
_2="-D LLVM_STATIC=ON"
|
||||
PRINT " $_1"
|
||||
PRINT " $_2"
|
||||
@@ -3053,10 +3039,10 @@ print_info() {
|
||||
PRINT "BF_OPENEXR = '$INST/openexr'"
|
||||
|
||||
_ilm_libs_ext=""
|
||||
#~ version_ge $OPENEXR_VERSION "2.1.0"
|
||||
#~ if [ $? -eq 0 ]; then
|
||||
#~ _ilm_libs_ext=`echo $OPENEXR_VERSION | sed -r 's/([0-9]+)\.([0-9]+).*/-\1_\2/'`
|
||||
#~ fi
|
||||
version_ge $OPENEXR_VERSION "2.1.0"
|
||||
if [ $? -eq 0 ]; then
|
||||
_ilm_libs_ext=`echo $OPENEXR_VERSION | sed -r 's/([0-9]+)\.([0-9]+).*/-\1_\2/'`
|
||||
fi
|
||||
PRINT "BF_OPENEXR_LIB = 'Half IlmImf$_ilm_libs_ext Iex$_ilm_libs_ext Imath$_ilm_libs_ext '"
|
||||
# BF_OPENEXR_LIB does not work, things like '-lIlmImf-2_1' do not suit ld.
|
||||
# For now, hack around!!!
|
||||
|
@@ -124,15 +124,13 @@ BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
BF_IS_NEW_OSL = False
|
||||
WITH_BF_CYCLES_OSL = True
|
||||
WITH_BF_STATICOSL = BF_IS_NEW_OSL
|
||||
WITH_BF_STATICOSL = False
|
||||
BF_OSL = '/opt/lib/osl'
|
||||
BF_OSL_INC = '${BF_OSL}/include'
|
||||
# note oslexec would passed via program linkflags, which is needed to
|
||||
# make llvm happy with osl_allocate_closure_component
|
||||
BF_OSL_LIB = 'oslcomp oslexec oslquery'
|
||||
BF_OSL_LIB_STATIC = '${BF_OSL}/lib/liboslcomp.a ${BF_OSL}/lib/liboslexec.a ${BF_OSL}/lib/liboslquery.a'
|
||||
BF_OSL_LIBPATH = '${BF_OSL}/lib'
|
||||
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
|
||||
|
||||
@@ -159,8 +157,6 @@ BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
|
||||
${BF_BOOST_LIBPATH}/libboost_thread.a'
|
||||
if BF_IS_NEW_OSL:
|
||||
BF_BOOST_LIB_STATIC += ' ${BF_BOOST_LIBPATH}/libboost_wave.a'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
# Ocean Simulation
|
||||
@@ -170,7 +166,4 @@ WITH_BF_OCEANSIM = True
|
||||
BF_DEBUG = False
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
|
||||
PLATFORM_LINKFLAGS = ['-lrt']
|
||||
if BF_IS_NEW_OSL:
|
||||
BF_PROGRAM_LINKFLAGS = ['-Wl,--version-script=source/creator/blender.map']
|
||||
else:
|
||||
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
|
||||
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
|
||||
|
@@ -124,15 +124,13 @@ BF_OIIO_INC = '${BF_OIIO}/include'
|
||||
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
|
||||
BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
|
||||
|
||||
BF_IS_NEW_OSL = False
|
||||
WITH_BF_CYCLES_OSL = True
|
||||
WITH_BF_STATICOSL = BF_IS_NEW_OSL
|
||||
WITH_BF_STATICOSL = False
|
||||
BF_OSL = '/opt/lib/osl'
|
||||
BF_OSL_INC = '${BF_OSL}/include'
|
||||
# note oslexec would passed via program linkflags, which is needed to
|
||||
# make llvm happy with osl_allocate_closure_component
|
||||
BF_OSL_LIB = 'oslcomp oslexec oslquery'
|
||||
BF_OSL_LIB_STATIC = '${BF_OSL}/lib/liboslcomp.a ${BF_OSL}/lib/liboslexec.a ${BF_OSL}/lib/liboslquery.a'
|
||||
BF_OSL_LIBPATH = '${BF_OSL}/lib'
|
||||
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
|
||||
|
||||
@@ -159,8 +157,6 @@ BF_BOOST_INC = '${BF_BOOST}/include'
|
||||
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
|
||||
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
|
||||
${BF_BOOST_LIBPATH}/libboost_thread.a'
|
||||
if BF_IS_NEW_OSL:
|
||||
BF_BOOST_LIB_STATIC += ' ${BF_BOOST_LIBPATH}/libboost_wave.a'
|
||||
BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
|
||||
# Ocean Simulation
|
||||
@@ -170,7 +166,4 @@ WITH_BF_OCEANSIM = True
|
||||
BF_DEBUG = False
|
||||
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
|
||||
PLATFORM_LINKFLAGS = ['-lrt']
|
||||
if BF_IS_NEW_OSL:
|
||||
BF_PROGRAM_LINKFLAGS = ['-Wl,--version-script=source/creator/blender.map']
|
||||
else:
|
||||
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
|
||||
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
|
||||
|
@@ -1,6 +1,5 @@
|
||||
CC = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang"
|
||||
CXX = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang++"
|
||||
|
||||
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
|
||||
|
||||
WITH_BF_CYCLES_CUDA_BINARIES = True
|
||||
|
||||
|
@@ -4,10 +4,10 @@
|
||||
# <pep8 compliant>
|
||||
|
||||
# List of the branches being built automatically overnight
|
||||
NIGHT_SCHEDULE_BRANCHES = [None, "gooseberry"]
|
||||
NIGHT_SCHEDULE_BRANCHES=[None, "gooseberry"]
|
||||
|
||||
# List of the branches available for force build
|
||||
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
|
||||
FORCE_SCHEDULE_BRANCHES=["master", "gooseberry", "experimental-build"]
|
||||
|
||||
"""
|
||||
Stock Twisted directory lister doesn't provide any information about last file
|
||||
@@ -17,7 +17,6 @@ modification time, we hack the class a bit in order to have such functionaliity
|
||||
|
||||
from buildbot.status.web.base import DirectoryLister
|
||||
|
||||
|
||||
def get_files_and_directories(self, directory):
|
||||
from twisted.web.static import (getTypeAndEncoding,
|
||||
formatFileSize)
|
||||
@@ -98,7 +97,6 @@ all_repositories = {
|
||||
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
|
||||
}
|
||||
|
||||
|
||||
def codebaseGenerator(chdict):
|
||||
return all_repositories[chdict['repository']]
|
||||
|
||||
@@ -114,7 +112,6 @@ from buildbot.schedulers import timed, forcesched
|
||||
|
||||
c['schedulers'] = []
|
||||
|
||||
|
||||
def schedule_force_build(name):
|
||||
c['schedulers'].append(forcesched.ForceScheduler(name='force ' + name,
|
||||
builderNames=[name],
|
||||
@@ -146,7 +143,7 @@ def schedule_build(name, hour, minute=0):
|
||||
"blender-addons": {"repository": "", "branch": "master"},
|
||||
"blender-addons-contrib": {"repository": "", "branch": "master"},
|
||||
"scons": {"repository": "", "branch": "master"},
|
||||
"lib svn": {"repository": "", "branch": "trunk"}},
|
||||
"lib svn": {"repository": "", "branch": "master"}},
|
||||
branch=current_branch,
|
||||
builderNames=[name],
|
||||
hour=hour,
|
||||
|
@@ -37,7 +37,6 @@ def strip_extension(filename):
|
||||
|
||||
return filename
|
||||
|
||||
|
||||
# extract platform from package name
|
||||
def get_platform(filename):
|
||||
# name is blender-version-platform.extension. we want to get the
|
||||
@@ -65,11 +64,10 @@ def get_platform(filename):
|
||||
|
||||
return '-'.join(platform_tokens)
|
||||
|
||||
|
||||
def get_branch(filename):
|
||||
tokens = filename.split("-")
|
||||
branch = ""
|
||||
|
||||
|
||||
for token in tokens:
|
||||
if token == "blender":
|
||||
return branch
|
||||
@@ -95,7 +93,7 @@ if not os.path.exists(filename):
|
||||
|
||||
try:
|
||||
z = zipfile.ZipFile(filename, "r")
|
||||
except Exception as ex:
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Failed to open zip file: %s\n' % str(ex))
|
||||
sys.exit(1)
|
||||
|
||||
@@ -131,7 +129,7 @@ try:
|
||||
|
||||
zf.close()
|
||||
z.close()
|
||||
except Exception as ex:
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
|
||||
sys.exit(1)
|
||||
|
||||
@@ -141,6 +139,6 @@ try:
|
||||
if get_platform(f) == platform and get_branch(f) == branch:
|
||||
if f != packagename:
|
||||
os.remove(os.path.join(directory, f))
|
||||
except Exception as ex:
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Failed to remove old packages: %s\n' % str(ex))
|
||||
sys.exit(1)
|
||||
|
@@ -47,9 +47,9 @@ if 'cmake' in builder:
|
||||
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
|
||||
|
||||
if 'win64' in builder:
|
||||
cmake_options.append(['-G', '"Visual Studio 12 2013 Win64"'])
|
||||
cmake_options.append(['-G','"Visual Studio 12 2013 Win64"'])
|
||||
elif 'win32' in builder:
|
||||
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
|
||||
cmake_options.append(['-G','"Visual Studio 12 2013"'])
|
||||
|
||||
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
|
||||
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
|
||||
|
@@ -116,12 +116,12 @@ if builder.find('scons') != -1:
|
||||
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options)
|
||||
sys.exit(retcode)
|
||||
else:
|
||||
# CMake
|
||||
#cmake
|
||||
if 'win' in builder:
|
||||
files = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')]
|
||||
for f in files:
|
||||
os.remove(f)
|
||||
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
|
||||
retcode = subprocess.call(['cpack', '-G','ZIP'])
|
||||
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
|
||||
os.rename(result_file, "{}.zip".format(builder))
|
||||
# create zip file
|
||||
@@ -133,7 +133,7 @@ else:
|
||||
z.write("{}.zip".format(builder))
|
||||
z.close()
|
||||
sys.exit(retcode)
|
||||
except Exception as ex:
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
@@ -149,7 +149,7 @@ if os.path.exists(release_dir):
|
||||
# create release package
|
||||
try:
|
||||
subprocess.call(['make', 'package_archive'])
|
||||
except Exception as ex:
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Make package release failed' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
||||
@@ -180,6 +180,6 @@ try:
|
||||
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
|
||||
z.write(filepath, arcname=file)
|
||||
z.close()
|
||||
except Exception as ex:
|
||||
except Exception, ex:
|
||||
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
|
||||
sys.exit(1)
|
||||
|
@@ -1,56 +0,0 @@
|
||||
# - Find Eigen3 library
|
||||
# Find the native Eigen3 includes and library
|
||||
# This module defines
|
||||
# EIGEN3_INCLUDE_DIRS, where to find spnav.h, Set when
|
||||
# EIGEN3_INCLUDE_DIR is found.
|
||||
# EIGEN3_ROOT_DIR, The base directory to search for Eigen3.
|
||||
# This can also be an environment variable.
|
||||
# EIGEN3_FOUND, If false, do not try to use Eigen3.
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright 2015 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If EIGEN3_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
|
||||
SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_eigen3_SEARCH_DIRS
|
||||
${EIGEN3_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(EIGEN3_INCLUDE_DIR
|
||||
NAMES
|
||||
# header has no '.h' suffix
|
||||
Eigen/Eigen
|
||||
HINTS
|
||||
${_eigen3_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/eigen3
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
|
||||
EIGEN3_INCLUDE_DIR)
|
||||
|
||||
IF(EIGEN3_FOUND)
|
||||
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
|
||||
ENDIF(EIGEN3_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
EIGEN3_INCLUDE_DIR
|
||||
)
|
@@ -33,7 +33,6 @@ SET(_jemalloc_SEARCH_DIRS
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt/lib/jemalloc
|
||||
)
|
||||
|
||||
FIND_PATH(JEMALLOC_INCLUDE_DIR
|
||||
|
@@ -1,68 +0,0 @@
|
||||
# - Find LZO library
|
||||
# Find the native LZO includes and library
|
||||
# This module defines
|
||||
# LZO_INCLUDE_DIRS, where to find lzo1x.h, Set when
|
||||
# LZO_INCLUDE_DIR is found.
|
||||
# LZO_LIBRARIES, libraries to link against to use LZO.
|
||||
# LZO_ROOT_DIR, The base directory to search for LZO.
|
||||
# This can also be an environment variable.
|
||||
# LZO_FOUND, If false, do not try to use LZO.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# LZO_LIBRARY, where to find the LZO library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2015 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If LZO_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "")
|
||||
SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_lzo_SEARCH_DIRS
|
||||
${LZO_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(LZO_INCLUDE_DIR lzo/lzo1x.h
|
||||
HINTS
|
||||
${_lzo_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(LZO_LIBRARY
|
||||
NAMES
|
||||
lzo2
|
||||
HINTS
|
||||
${_lzo_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
|
||||
LZO_LIBRARY LZO_INCLUDE_DIR)
|
||||
|
||||
IF(LZO_FOUND)
|
||||
SET(LZO_LIBRARIES ${LZO_LIBRARY})
|
||||
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
|
||||
ENDIF(LZO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
LZO_INCLUDE_DIR
|
||||
LZO_LIBRARY
|
||||
)
|
@@ -51,7 +51,6 @@ SET(_openexr_SEARCH_DIRS
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt/lib/openexr
|
||||
)
|
||||
|
||||
FIND_PATH(OPENEXR_INCLUDE_DIR
|
||||
|
@@ -71,7 +71,6 @@ ENDIF()
|
||||
MARK_AS_ADVANCED(
|
||||
OPENGLES_EGL_INCLUDE_DIR
|
||||
OPENGLES_EGL_LIBRARY
|
||||
OPENGLES_LIBRARY
|
||||
OPENGLES_INCLUDE_DIR
|
||||
)
|
||||
|
||||
|
@@ -7,8 +7,6 @@
|
||||
# OPENIMAGEIO_ROOT_DIR, The base directory to search for OpenImageIO.
|
||||
# This can also be an environment variable.
|
||||
# OPENIMAGEIO_FOUND, If false, do not try to use OpenImageIO.
|
||||
# OPENIMAGEIO_PUGIXML_FOUND, Indicates whether OIIO has biltin PuguXML parser.
|
||||
# OPENIMAGEIO_IDIFF, full path to idiff application if found.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library.
|
||||
@@ -56,14 +54,6 @@ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
FIND_FILE(OPENIMAGEIO_IDIFF
|
||||
NAMES
|
||||
idiff
|
||||
${OPENIMAGEIO_ROOT_DIR}
|
||||
PATH_SUFFIXES
|
||||
bin
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
@@ -73,17 +63,11 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_MSG
|
||||
IF(OPENIMAGEIO_FOUND)
|
||||
SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
|
||||
SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
|
||||
IF(EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/pugixml.hpp)
|
||||
SET(OPENIMAGEIO_PUGIXML_FOUND TRUE)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(OPENIMAGEIO_PUGIXML_FOUND FALSE)
|
||||
ENDIF()
|
||||
ENDIF(OPENIMAGEIO_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OPENIMAGEIO_INCLUDE_DIR
|
||||
OPENIMAGEIO_LIBRARY
|
||||
OPENIMAGEIO_IDIFF
|
||||
)
|
||||
|
||||
UNSET(_openimageio_SEARCH_DIRS)
|
||||
|
@@ -1,98 +0,0 @@
|
||||
# - Find OpenShadingLanguage library
|
||||
# Find the native OpenShadingLanguage includes and library
|
||||
# This module defines
|
||||
# OSL_INCLUDE_DIRS, where to find OSL headers, Set when
|
||||
# OSL_INCLUDE_DIR is found.
|
||||
# OSL_LIBRARIES, libraries to link against to use OSL.
|
||||
# OSL_ROOT_DIR, the base directory to search for OSL.
|
||||
# This can also be an environment variable.
|
||||
# OSL_COMPILER, full path to OSL script compiler.
|
||||
# OSL_FOUND, if false, do not try to use OSL.
|
||||
# OSL_LIBRARY_VERSION_MAJOR, OSL_LIBRARY_VERSION_MINOR, the major
|
||||
# and minor versions of OSL library if found.
|
||||
#
|
||||
#=============================================================================
|
||||
# Copyright 2014 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If OSL_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT OSL_ROOT_DIR AND NOT $ENV{OSL_ROOT_DIR} STREQUAL "")
|
||||
SET(OSL_ROOT_DIR $ENV{OSL_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_osl_FIND_COMPONENTS
|
||||
oslcomp
|
||||
oslexec
|
||||
oslquery
|
||||
)
|
||||
|
||||
SET(_osl_SEARCH_DIRS
|
||||
${OSL_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt/lib/osl
|
||||
)
|
||||
|
||||
FIND_PATH(OSL_INCLUDE_DIR
|
||||
NAMES
|
||||
OSL/oslversion.h
|
||||
HINTS
|
||||
${_osl_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
SET(_osl_LIBRARIES)
|
||||
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
|
||||
FIND_LIBRARY(OSL_${UPPERCOMPONENT}_LIBRARY
|
||||
NAMES
|
||||
${COMPONENT}
|
||||
HINTS
|
||||
${_osl_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
LIST(APPEND _osl_LIBRARIES "${OSL_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDFOREACH()
|
||||
|
||||
FIND_PROGRAM(OSL_COMPILER oslc
|
||||
HINTS ${_osl_SEARCH_DIRS}
|
||||
PATH_SUFFIXES bin)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OSL_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSL DEFAULT_MSG _osl_LIBRARIES OSL_INCLUDE_DIR OSL_COMPILER)
|
||||
|
||||
IF(OSL_FOUND)
|
||||
SET(OSL_LIBRARIES ${_osl_LIBRARIES})
|
||||
SET(OSL_INCLUDE_DIRS ${OSL_INCLUDE_DIR})
|
||||
|
||||
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MAJOR
|
||||
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+[0-9]+.*$")
|
||||
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MINOR
|
||||
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+[0-9]+.*$")
|
||||
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+([.0-9]+).*"
|
||||
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
|
||||
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
|
||||
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
|
||||
ENDIF(OSL_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
OSL_INCLUDE_DIR
|
||||
)
|
||||
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
MARK_AS_ADVANCED(OSL_${UPPERCOMPONENT}_LIBRARY)
|
||||
ENDFOREACH()
|
@@ -40,6 +40,7 @@ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
|
||||
${_pcre_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(PCRE_LIBRARY
|
||||
|
@@ -1,73 +0,0 @@
|
||||
# - Find PugiXML library
|
||||
# Find the native PugiXML includes and library
|
||||
# This module defines
|
||||
# PUGIXML_INCLUDE_DIRS, where to find pugixml.hpp, Set when
|
||||
# PugiXML is found.
|
||||
# PUGIXML_LIBRARIES, libraries to link against to use PugiiXML.
|
||||
# PUGIXML_ROOT_DIR, The base directory to search for PugiXML.
|
||||
# This can also be an environment variable.
|
||||
# PUGIXML_FOUND, If false, do not try to use PugiXML.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# PUGIXML_LIBRARY, where to find the PugiXML library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2014 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If PUGIXML_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT PUGIXML_ROOT_DIR AND NOT $ENV{PUGIXML_ROOT_DIR} STREQUAL "")
|
||||
SET(PUGIXML_ROOT_DIR $ENV{PUGIXML_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_pugixml_SEARCH_DIRS
|
||||
${PUGIXML_ROOT_DIR}
|
||||
/usr/local
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
/opt/lib/oiio
|
||||
)
|
||||
|
||||
FIND_PATH(PUGIXML_INCLUDE_DIR
|
||||
NAMES
|
||||
pugixml.hpp
|
||||
HINTS
|
||||
${_pugixml_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(PUGIXML_LIBRARY
|
||||
NAMES
|
||||
pugixml
|
||||
HINTS
|
||||
${_pugixml_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG
|
||||
PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
||||
|
||||
IF(PUGIXML_FOUND)
|
||||
SET(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
|
||||
SET(PUGIXML_INCLUDE_DIRS ${PUGIXML_INCLUDE_DIR})
|
||||
ELSE()
|
||||
SET(PUGIXML_PUGIXML_FOUND FALSE)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
PUGIXML_INCLUDE_DIR
|
||||
PUGIXML_LIBRARY
|
||||
)
|
@@ -14,7 +14,6 @@
|
||||
# PYTHON_INCLUDE_CONFIG_DIRS
|
||||
# PYTHON_LIBRARIES
|
||||
# PYTHON_LIBPATH, Used for installation
|
||||
# PYTHON_SITE_PACKAGES, Used for installation (as a Python module)
|
||||
# PYTHON_LINKFLAGS
|
||||
# PYTHON_ROOT_DIR, The base directory to search for Python.
|
||||
# This can also be an environment variable.
|
||||
@@ -188,15 +187,6 @@ IF(PYTHONLIBSUNIX_FOUND)
|
||||
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
|
||||
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
|
||||
|
||||
FIND_FILE(PYTHON_SITE_PACKAGES
|
||||
NAMES
|
||||
# debian specific
|
||||
dist-packages
|
||||
site-packages
|
||||
HINTS
|
||||
${PYTHON_LIBPATH}/python${PYTHON_VERSION}
|
||||
)
|
||||
|
||||
# we need this for installation
|
||||
# XXX No more valid with debian-like py3.4 packages...
|
||||
# GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
|
||||
@@ -210,5 +200,4 @@ MARK_AS_ADVANCED(
|
||||
PYTHON_INCLUDE_CONFIG_DIR
|
||||
PYTHON_LIBRARY
|
||||
PYTHON_LIBPATH
|
||||
PYTHON_SITE_PACKAGES
|
||||
)
|
||||
|
@@ -1,72 +0,0 @@
|
||||
# - Find SDL library
|
||||
# Find the native SDL includes and library
|
||||
# This module defines
|
||||
# SDL2_INCLUDE_DIRS, where to find SDL.h, Set when SDL2_INCLUDE_DIR is found.
|
||||
# SDL2_LIBRARIES, libraries to link against to use SDL.
|
||||
# SDL2_ROOT_DIR, The base directory to search for SDL.
|
||||
# This can also be an environment variable.
|
||||
# SDL2_FOUND, If false, do not try to use SDL.
|
||||
#
|
||||
# also defined, but not for general use are
|
||||
# SDL2_LIBRARY, where to find the SDL library.
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2015 Blender Foundation.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
|
||||
# If SDL2_ROOT_DIR was defined in the environment, use it.
|
||||
IF(NOT SDL2_ROOT_DIR AND NOT $ENV{SDL2_ROOT_DIR} STREQUAL "")
|
||||
SET(SDL2_ROOT_DIR $ENV{SDL2_ROOT_DIR})
|
||||
ENDIF()
|
||||
|
||||
SET(_sdl2_SEARCH_DIRS
|
||||
${SDL2_ROOT_DIR}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/usr/local
|
||||
/usr
|
||||
/sw # Fink
|
||||
/opt/local # DarwinPorts
|
||||
/opt/csw # Blastwave
|
||||
)
|
||||
|
||||
FIND_PATH(SDL2_INCLUDE_DIR
|
||||
NAMES
|
||||
SDL.h
|
||||
HINTS
|
||||
${_sdl2_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
include/SDL2 include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(SDL2_LIBRARY
|
||||
NAMES
|
||||
SDL2
|
||||
HINTS
|
||||
${_sdl2_SEARCH_DIRS}
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
|
||||
SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||
|
||||
IF(SDL2_FOUND)
|
||||
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
|
||||
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
|
||||
ENDIF(SDL2_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
SDL2_INCLUDE_DIR
|
||||
SDL2_LIBRARY
|
||||
)
|
@@ -32,8 +32,6 @@ macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
|
||||
bf_testing_main
|
||||
bf_intern_guardedalloc
|
||||
extern_gtest
|
||||
# needed for glog
|
||||
${PTHREADS_LIBRARIES}
|
||||
extern_glog)
|
||||
set_target_properties(${NAME}_test PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"
|
||||
|
@@ -60,8 +60,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
|
||||
execute_process(COMMAND git log HEAD..@{u}
|
||||
WORKING_DIRECTORY ${SOURCE_DIR}
|
||||
OUTPUT_VARIABLE _git_below_check
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT _git_below_check STREQUAL "")
|
||||
# If there're commits between HEAD and upstream this means
|
||||
# that we're reset-ed to older revision. Use it's hash then.
|
||||
|
@@ -187,8 +187,6 @@ def cmake_get_src(f):
|
||||
pass
|
||||
elif new_file.endswith(".osl"): # open shading language
|
||||
pass
|
||||
elif new_file.endswith(".glsl"):
|
||||
pass
|
||||
else:
|
||||
raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
|
||||
|
||||
@@ -307,7 +305,7 @@ if UTF8_CHECK:
|
||||
try:
|
||||
for l in open(f, "r", encoding="utf8"):
|
||||
i += 1
|
||||
except UnicodeDecodeError:
|
||||
except:
|
||||
print("Non utf8: %s:%d" % (f, i))
|
||||
if i > 1:
|
||||
traceback.print_exc()
|
||||
|
@@ -29,19 +29,18 @@ Example linux usage
|
||||
Windows not supported so far
|
||||
"""
|
||||
|
||||
from project_info import (
|
||||
SIMPLE_PROJECTFILE,
|
||||
SOURCE_DIR,
|
||||
CMAKE_DIR,
|
||||
PROJECT_DIR,
|
||||
source_list,
|
||||
is_project_file,
|
||||
is_c_header,
|
||||
# is_py,
|
||||
cmake_advanced_info,
|
||||
cmake_compiler_defines,
|
||||
project_name_get,
|
||||
)
|
||||
from project_info import (SIMPLE_PROJECTFILE,
|
||||
SOURCE_DIR,
|
||||
CMAKE_DIR,
|
||||
PROJECT_DIR,
|
||||
source_list,
|
||||
is_project_file,
|
||||
is_c_header,
|
||||
# is_py,
|
||||
cmake_advanced_info,
|
||||
cmake_compiler_defines,
|
||||
project_name_get,
|
||||
)
|
||||
|
||||
|
||||
import os
|
||||
|
@@ -22,27 +22,26 @@
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
r"""
|
||||
Example Linux usage:
|
||||
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
|
||||
|
||||
"""
|
||||
Example Win32 usage:
|
||||
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
|
||||
|
||||
example linux usage
|
||||
python .~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
|
||||
"""
|
||||
|
||||
from project_info import (
|
||||
SIMPLE_PROJECTFILE,
|
||||
SOURCE_DIR,
|
||||
# CMAKE_DIR,
|
||||
PROJECT_DIR,
|
||||
source_list,
|
||||
is_project_file,
|
||||
is_c_header,
|
||||
is_py,
|
||||
cmake_advanced_info,
|
||||
cmake_compiler_defines,
|
||||
project_name_get,
|
||||
)
|
||||
from project_info import (SIMPLE_PROJECTFILE,
|
||||
SOURCE_DIR,
|
||||
# CMAKE_DIR,
|
||||
PROJECT_DIR,
|
||||
source_list,
|
||||
is_project_file,
|
||||
is_c_header,
|
||||
is_py,
|
||||
cmake_advanced_info,
|
||||
cmake_compiler_defines,
|
||||
project_name_get,
|
||||
)
|
||||
|
||||
import os
|
||||
import sys
|
||||
@@ -64,19 +63,18 @@ def create_qtc_project_main():
|
||||
if SIMPLE_PROJECTFILE:
|
||||
# --- qtcreator specific, simple format
|
||||
PROJECT_NAME = "Blender"
|
||||
FILE_NAME = PROJECT_NAME.lower()
|
||||
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
|
||||
with open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w') as f:
|
||||
f.write("\n".join(files_rel))
|
||||
|
||||
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') as f:
|
||||
with open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w') as f:
|
||||
f.write("\n".join(sorted(list(set(os.path.dirname(f)
|
||||
for f in files_rel if is_c_header(f))))))
|
||||
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
|
||||
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
|
||||
with open(qtc_prj, 'w') as f:
|
||||
f.write("[General]\n")
|
||||
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
|
||||
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
|
||||
if not os.path.exists(qtc_cfg):
|
||||
with open(qtc_cfg, 'w') as f:
|
||||
f.write("// ADD PREDEFINED MACROS HERE!\n")
|
||||
|
@@ -118,19 +118,6 @@ macro(target_link_libraries_debug TARGET LIBS)
|
||||
unset(_LIB)
|
||||
endmacro()
|
||||
|
||||
macro(target_link_libraries_decoupled target libraries_var)
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(${target} ${${libraries_var}})
|
||||
else()
|
||||
# For MSVC we link to different libraries depending whether
|
||||
# release or debug target is being built.
|
||||
file_list_suffix(_libraries_debug "${${libraries_var}}" "_d")
|
||||
target_link_libraries_debug(${target} "${_libraries_debug}")
|
||||
target_link_libraries_optimized(${target} "${${libraries_var}}")
|
||||
unset(_libraries_debug)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
|
||||
# use it instead of include_directories()
|
||||
macro(blender_include_dirs
|
||||
@@ -296,13 +283,8 @@ macro(setup_liblinks
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
|
||||
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
|
||||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
|
||||
|
||||
target_link_libraries(${target}
|
||||
${BLENDER_GL_LIBRARIES}
|
||||
${PNG_LIBRARIES}
|
||||
${ZLIB_LIBRARIES}
|
||||
${FREETYPE_LIBRARY})
|
||||
@@ -321,9 +303,6 @@ macro(setup_liblinks
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_LZO AND WITH_SYSTEM_LZO)
|
||||
target_link_libraries(${target} ${LZO_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_SYSTEM_GLEW)
|
||||
target_link_libraries(${target} ${BLENDER_GLEW_LIBRARIES})
|
||||
endif()
|
||||
@@ -357,9 +336,6 @@ macro(setup_liblinks
|
||||
if(WITH_OPENCOLORIO)
|
||||
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CYCLES_OSL)
|
||||
target_link_libraries(${target} ${OSL_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_BOOST)
|
||||
target_link_libraries(${target} ${BOOST_LIBRARIES})
|
||||
if(Boost_USE_STATIC_LIBS AND Boost_USE_ICU)
|
||||
@@ -381,6 +357,14 @@ macro(setup_liblinks
|
||||
target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CODEC_FFMPEG)
|
||||
|
||||
# Strange! Without this ffmpeg gives linking errors (on linux),
|
||||
# even though it's linked above.
|
||||
# XXX: Does FFMPEG depend on GLU?
|
||||
if(WITH_GLU)
|
||||
target_link_libraries(${target} ${OPENGL_glu_LIBRARY})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${target} ${FFMPEG_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_OPENCOLLADA)
|
||||
@@ -418,6 +402,9 @@ macro(setup_liblinks
|
||||
if(WITH_MOD_CLOTH_ELTOPO)
|
||||
target_link_libraries(${target} ${LAPACK_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_CYCLES_OSL)
|
||||
target_link_libraries(${target} ${OSL_LIBRARIES})
|
||||
endif()
|
||||
if(WITH_LLVM)
|
||||
target_link_libraries(${target} ${LLVM_LIBRARY})
|
||||
endif()
|
||||
@@ -425,17 +412,13 @@ macro(setup_liblinks
|
||||
target_link_libraries(${target} ${PTHREADS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
|
||||
|
||||
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
|
||||
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
|
||||
target_link_libraries(${target} "extern_clew")
|
||||
target_link_libraries(${target} "extern_cuew")
|
||||
endif()
|
||||
|
||||
#system libraries with no dependencies such as platform link libs or opengl should go last
|
||||
target_link_libraries(${target}
|
||||
${BLENDER_GL_LIBRARIES})
|
||||
|
||||
target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
|
||||
endmacro()
|
||||
|
||||
macro(SETUP_BLENDER_SORTED_LIBS)
|
||||
@@ -517,7 +500,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
|
||||
bf_modifiers
|
||||
bf_bmesh
|
||||
bf_blenkernel
|
||||
bf_physics
|
||||
bf_nodes
|
||||
bf_rna
|
||||
bf_gpu
|
||||
@@ -542,6 +524,7 @@ macro(SETUP_BLENDER_SORTED_LIBS)
|
||||
ge_phys_dummy
|
||||
ge_phys_bullet
|
||||
bf_intern_smoke
|
||||
extern_minilzo
|
||||
extern_lzma
|
||||
extern_colamd
|
||||
ge_logic_ketsji
|
||||
@@ -595,10 +578,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
|
||||
list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_SYSTEM_LZO)
|
||||
list(APPEND BLENDER_SORTED_LIBS extern_minilzo)
|
||||
endif()
|
||||
|
||||
if(NOT WITH_SYSTEM_GLEW)
|
||||
list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES})
|
||||
endif()
|
||||
@@ -931,7 +910,6 @@ macro(remove_strict_flags)
|
||||
remove_cc_flag("-Wstrict-prototypes")
|
||||
remove_cc_flag("-Wmissing-prototypes")
|
||||
remove_cc_flag("-Wunused-parameter")
|
||||
remove_cc_flag("-Wunused-macros")
|
||||
remove_cc_flag("-Wwrite-strings")
|
||||
remove_cc_flag("-Wredundant-decls")
|
||||
remove_cc_flag("-Wundef")
|
||||
@@ -961,20 +939,6 @@ macro(remove_strict_flags)
|
||||
|
||||
endmacro()
|
||||
|
||||
macro(remove_extra_strict_flags)
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
remove_cc_flag("-Wunused-parameter")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
remove_cc_flag("-Wunused-parameter")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# TODO
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# note, we can only append flags on a single file so we need to negate the options.
|
||||
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
|
||||
# probably add more removals here.
|
||||
@@ -1036,15 +1000,6 @@ macro(ADD_CHECK_CXX_COMPILER_FLAG
|
||||
endmacro()
|
||||
|
||||
function(get_blender_version)
|
||||
# extracts header vars and defines them in the parent scope:
|
||||
#
|
||||
# - BLENDER_VERSION (major.minor)
|
||||
# - BLENDER_VERSION_MAJOR
|
||||
# - BLENDER_VERSION_MINOR
|
||||
# - BLENDER_SUBVERSION (used for internal versioning mainly)
|
||||
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
|
||||
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
|
||||
|
||||
# So cmake depends on BKE_blender.h, beware of inf-loops!
|
||||
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h
|
||||
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
|
||||
@@ -1077,28 +1032,25 @@ function(get_blender_version)
|
||||
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE")
|
||||
endif()
|
||||
|
||||
math(EXPR _out_version_major "${_out_version} / 100")
|
||||
math(EXPR _out_version_minor "${_out_version} % 100")
|
||||
math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
|
||||
math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
|
||||
set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}" PARENT_SCOPE)
|
||||
|
||||
set(BLENDER_SUBVERSION ${_out_subversion} PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR ${_out_version_char} PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CYCLE ${_out_version_cycle} PARENT_SCOPE)
|
||||
|
||||
# for packaging, alpha to numbers
|
||||
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
|
||||
string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
|
||||
if(${_out_version_char_empty})
|
||||
set(_out_version_char_index "0")
|
||||
set(BLENDER_VERSION_CHAR_INDEX "0" PARENT_SCOPE)
|
||||
else()
|
||||
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
|
||||
list(FIND _char_ls ${_out_version_char} _out_version_char_index)
|
||||
math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
|
||||
list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
|
||||
math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1" PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
# output vars
|
||||
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
|
||||
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
|
||||
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
|
||||
|
||||
# message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
|
||||
endfunction()
|
||||
|
||||
|
||||
@@ -1136,7 +1088,7 @@ endmacro()
|
||||
macro(blender_project_hack_post)
|
||||
# --------------
|
||||
# MINGW HACK END
|
||||
if(_reset_standard_libraries)
|
||||
if (_reset_standard_libraries)
|
||||
# Must come after projecINCt(...)
|
||||
#
|
||||
# MINGW workaround for -ladvapi32 being included which surprisingly causes
|
||||
|
@@ -27,8 +27,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
|
||||
execute_process(COMMAND git rev-parse --short @{u}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE MY_WC_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
endif()
|
||||
set(BUILD_REV ${MY_WC_HASH})
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/python
|
||||
|
||||
# <pep8 compliant>
|
||||
|
||||
|
@@ -12,9 +12,9 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen
|
||||
# map the version a -> 1
|
||||
# not to be confused with blender's internal subversions
|
||||
if [ "$blender_version_char" ]; then
|
||||
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
|
||||
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
|
||||
else
|
||||
blender_version_full=${blender_version}
|
||||
blender_version_full=${blender_version}
|
||||
fi
|
||||
|
||||
blender_ver_string=$blender_version+git$blender_version_full
|
||||
@@ -60,7 +60,7 @@ package() {
|
||||
cd $srcdir/build
|
||||
make DESTDIR="$pkgdir" install
|
||||
python -m compileall \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/addons
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
|
||||
$pkgdir/usr/share/blender/$blender_version/scripts/addons
|
||||
}
|
||||
|
@@ -144,7 +144,7 @@ BF_REDCODE_LIB = ''
|
||||
BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
|
||||
BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
|
||||
|
||||
# Mesa Libs should go here if you're using them as well....
|
||||
# Mesa Libs should go here if your using them as well....
|
||||
WITH_BF_STATICOPENGL = False
|
||||
BF_OPENGL = '/usr'
|
||||
BF_OPENGL_INC = '${BF_OPENGL}/include'
|
||||
|
@@ -170,8 +170,6 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#CUDA
|
||||
@@ -198,10 +196,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
|
||||
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-ldbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('-limm32')
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-limm32']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
|
@@ -33,7 +33,7 @@ WITH_BF_PYTHON_INSTALL_NUMPY = True
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'OpenAL32'
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
WITH_BF_ICONV = True
|
||||
@@ -69,7 +69,7 @@ WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
|
||||
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 '
|
||||
BF_OPENEXR_LIB = ' Iex-2_1 Half IlmImf-2_1 Imath-2_1 IlmThread-2_1 '
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
|
||||
@@ -151,8 +151,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
@@ -237,10 +235,7 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('imm32')
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
|
@@ -169,8 +169,6 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
|
||||
WITH_BF_RAYOPTIMIZATION = True
|
||||
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
|
||||
#Freestyle
|
||||
@@ -188,15 +186,11 @@ REL_CFLAGS = []
|
||||
REL_CXXFLAGS = []
|
||||
REL_CCFLAGS = ['-O2', '-ftree-vectorize']
|
||||
|
||||
# NOTE: C_WARN seems to get ignored - at least -Wno-char-subscripts doesn't work!
|
||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
|
||||
|
||||
CC_WARN = [ '-Wall', '-Wno-char-subscripts' ]
|
||||
CC_WARN = [ '-Wall' ]
|
||||
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-ldbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('-limm32')
|
||||
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-limm32']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
|
||||
|
||||
|
@@ -34,7 +34,7 @@ WITH_BF_PYTHON_INSTALL_NUMPY = True
|
||||
WITH_BF_OPENAL = True
|
||||
BF_OPENAL = LIBDIR + '/openal'
|
||||
BF_OPENAL_INC = '${BF_OPENAL}/include '
|
||||
BF_OPENAL_LIB = 'OpenAL32'
|
||||
BF_OPENAL_LIB = 'wrap_oal'
|
||||
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
|
||||
|
||||
WITH_BF_SNDFILE = True
|
||||
@@ -66,7 +66,7 @@ WITH_BF_OPENEXR = True
|
||||
WITH_BF_STATICOPENEXR = False
|
||||
BF_OPENEXR = LIBDIR + '/openexr'
|
||||
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
|
||||
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 '
|
||||
BF_OPENEXR_LIB = ' Iex-2_1 Half IlmImf-2_1 Imath-2_1 IlmThread-2_1 '
|
||||
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
|
||||
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
|
||||
|
||||
@@ -154,8 +154,6 @@ BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
|
||||
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa'
|
||||
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
|
||||
|
||||
WITH_BF_IME = True
|
||||
|
||||
WITH_BF_3DMOUSE = True
|
||||
|
||||
WITH_BF_OPENMP = True
|
||||
@@ -244,10 +242,7 @@ C_WARN = []
|
||||
CC_WARN = []
|
||||
CXX_WARN = []
|
||||
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
|
||||
|
||||
if WITH_BF_IME:
|
||||
LLIBS.append('imm32')
|
||||
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'imm32']
|
||||
|
||||
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
|
||||
|
||||
|
28
build_files/scons/tools/Blender.py
Normal file → Executable file
28
build_files/scons/tools/Blender.py
Normal file → Executable file
@@ -216,16 +216,16 @@ def setup_staticlibs(lenv):
|
||||
if lenv['WITH_BF_STATICOCIO']:
|
||||
statlibs += Split(lenv['BF_OCIO_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_CYCLES_OSL']:
|
||||
libincs += Split(lenv['BF_OSL_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOSL']:
|
||||
statlibs += Split(lenv['BF_OSL_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_BOOST']:
|
||||
libincs += Split(lenv['BF_BOOST_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICBOOST']:
|
||||
statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_CYCLES_OSL']:
|
||||
libincs += Split(lenv['BF_OSL_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOSL']:
|
||||
statlibs += Split(lenv['BF_OSL_LIB_STATIC'])
|
||||
|
||||
if lenv['WITH_BF_LLVM']:
|
||||
libincs += Split(lenv['BF_LLVM_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICLLVM']:
|
||||
@@ -325,16 +325,16 @@ def setup_syslibs(lenv):
|
||||
if lenv['WITH_BF_3DMOUSE']:
|
||||
if not lenv['WITH_BF_STATIC3DMOUSE']:
|
||||
syslibs += Split(lenv['BF_3DMOUSE_LIB'])
|
||||
|
||||
if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
|
||||
syslibs += Split(lenv['BF_BOOST_LIB'])
|
||||
|
||||
if lenv['WITH_BF_INTERNATIONAL']:
|
||||
syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL'])
|
||||
|
||||
if lenv['WITH_BF_CYCLES_OSL'] and not lenv['WITH_BF_STATICOSL']:
|
||||
syslibs += Split(lenv['BF_OSL_LIB'])
|
||||
|
||||
if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
|
||||
syslibs += Split(lenv['BF_BOOST_LIB'])
|
||||
|
||||
if lenv['WITH_BF_INTERNATIONAL']:
|
||||
syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL'])
|
||||
|
||||
if lenv['WITH_BF_LLVM'] and not lenv['WITH_BF_STATICLLVM']:
|
||||
syslibs += Split(lenv['BF_LLVM_LIB'])
|
||||
|
||||
@@ -441,7 +441,7 @@ def buildinfo(lenv, build_type):
|
||||
no_upstream = False
|
||||
|
||||
try :
|
||||
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}'], stderr=subprocess.STDOUT).strip()
|
||||
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}']).strip()
|
||||
except subprocess.CalledProcessError:
|
||||
# assume branch has no upstream configured
|
||||
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
|
||||
@@ -654,7 +654,7 @@ def WinPyBundle(target=None, source=None, env=None):
|
||||
# Extract Numpy
|
||||
if env['WITH_BF_PYTHON_INSTALL_NUMPY']:
|
||||
py_tar = env.subst(env['LCGDIR']).lstrip("#")
|
||||
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.9.tar.gz'
|
||||
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
|
||||
|
||||
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
|
||||
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
|
||||
@@ -762,7 +762,7 @@ def AppIt(target=None, source=None, env=None):
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_math_fast.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
|
||||
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
|
||||
commands.getoutput(cmd)
|
||||
cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir)
|
||||
commands.getoutput(cmd)
|
||||
|
@@ -174,7 +174,6 @@ def validate_arguments(args, bc):
|
||||
'WITH_BF_CXX_GUARDEDALLOC',
|
||||
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
|
||||
'BUILDBOT_BRANCH',
|
||||
'WITH_BF_IME',
|
||||
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
|
||||
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'BF_CYCLES_CUDA_ENV',
|
||||
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
|
||||
@@ -198,8 +197,7 @@ def validate_arguments(args, bc):
|
||||
'C_WARN', 'CC_WARN', 'CXX_WARN',
|
||||
'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
|
||||
'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET',
|
||||
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING',
|
||||
'WITH_BF_CPP11'
|
||||
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING'
|
||||
]
|
||||
|
||||
|
||||
@@ -509,8 +507,6 @@ def read_opts(env, cfg, args):
|
||||
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
|
||||
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_IME', 'Enable Input Method Editor (IME) for complex Asian character input', False)),
|
||||
|
||||
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
|
||||
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
|
||||
('BF_3DMOUSE', '3d mouse library base path', ''),
|
||||
@@ -654,9 +650,7 @@ def read_opts(env, cfg, args):
|
||||
('BF_LLVM_LIBPATH', 'LLVM library path', ''),
|
||||
('BF_LLVM_LIB_STATIC', 'LLVM static library', ''),
|
||||
|
||||
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_CPP11', '"Build with C++11 standard enabled, for development use only!', False)),
|
||||
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', '')
|
||||
) # end of opts.AddOptions()
|
||||
|
||||
return localopts
|
||||
|
@@ -25,16 +25,7 @@ TARBALL="blender-$VERSION.tar.gz"
|
||||
cd "$blender_srcdir"
|
||||
|
||||
# not so nice, but works
|
||||
FILTER_FILES_PY=\
|
||||
"import os, sys; "\
|
||||
"[print(l[:-1]) for l in sys.stdin.readlines() "\
|
||||
"if os.path.isfile(l[:-1]) "\
|
||||
"if os.path.basename(l[:-1]) not in {"\
|
||||
"'.gitignore', "\
|
||||
"'.gitmodules', "\
|
||||
"'.arcconfig', "\
|
||||
"}"\
|
||||
"]"
|
||||
FILTER_FILES_PY="import os, sys; [print(l[:-1]) for l in sys.stdin.readlines() if os.path.isfile(l[:-1])]"
|
||||
|
||||
# Build master list
|
||||
echo -n "Building manifest of files: \"$BASE_DIR/$MANIFEST\" ..."
|
||||
|
@@ -35,14 +35,13 @@
|
||||
defaults.
|
||||
|
||||
Much of the actual functionality can be found in the python scripts
|
||||
in the directory $BLENDERHOME/build_files/scons/tools, with
|
||||
Blender.py defining the bulk of the functionality. btools.py has some
|
||||
helper functions, and bcolors.py is for the terminal
|
||||
colors. mstoolkit.py and crossmingw.py are modules which set up SCons
|
||||
for the MS VC++ 2003 toolkit and the cross-compile toolset for
|
||||
compiling Windows binaries on Linux respectively. Note: the
|
||||
cross-compile doesn't work yet for Blender, but is added in
|
||||
preparation for having it work in the distant future.
|
||||
in the directory $BLENDERHOME/tools, with Blender.py defining the
|
||||
bulk of the functionality. btools.py has some helper functions, and
|
||||
bcolors.py is for the terminal colors. mstoolkit.py and crossmingw.py
|
||||
are modules which set up SCons for the MS VC++ 2003 toolkit and
|
||||
the cross-compile toolset for compiling Windows binaries on Linux
|
||||
respectively. Note: the cross-compile doesn't work yet for Blender,
|
||||
but is added in preparation for having it work in the distant future.
|
||||
|
||||
BlenderEnvironment
|
||||
------------------
|
||||
|
@@ -29,9 +29,9 @@
|
||||
a scons-local installation, which can be found in the scons/ subdirectory.
|
||||
This document uses the scons-local installation for its examples.
|
||||
|
||||
For build instructions, including dependencies, consult the appropriate
|
||||
section for your platform at
|
||||
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender. Note that for
|
||||
Check from the page
|
||||
http://www.blender.org/development/building-blender/getting-dependencies/
|
||||
that you have all dependencies needed for building Blender. Note that for
|
||||
windows many of these dependencies already come in the lib/windows module
|
||||
from CVS.
|
||||
|
||||
@@ -53,13 +53,12 @@
|
||||
from the command-line is given, then all libraries and binaries to
|
||||
build are configured.
|
||||
|
||||
The build uses BF_BUILDDIR to build into and BF_INSTALLDIR to finally copy
|
||||
all needed files to get a proper setup. The BF_DOCDIR is used to generate
|
||||
Blender Python documentation files to. These variables have default values
|
||||
for every platform in
|
||||
$BLENDERHOME/build_files/scons/config/(platform)-config.py. See the next
|
||||
section of this document for how to customize these paths. After the build
|
||||
successfully completes, you can find everything you need in BF_INSTALLDIR.
|
||||
The build uses BF_BUILDDIR to build into and BF_INSTALLDIR to
|
||||
finally copy all needed files to get a proper setup. The BF_DOCDIR is
|
||||
used to generate Blender Python documentation files to. These
|
||||
variables have default values for every platform in
|
||||
$BLENDERHOME/config/(platform)-config.py. After the build successfully
|
||||
completes, you can find everything you need in BF_INSTALLDIR.
|
||||
|
||||
If you want to create the installer package of Blender on Windows you'll
|
||||
need to install nullsoft scriptable install system from http://nsis.sf.net.
|
||||
@@ -73,8 +72,8 @@
|
||||
---------------------
|
||||
|
||||
The default values for your platform can be found in the directory
|
||||
$BLENDERHOME/build_files/scons/config. Your platform specific defaults are
|
||||
in (platform)-config.py, where platform is one of:
|
||||
$BLENDERHOME/config. Your platform specific defaults are in
|
||||
(platform)-config.py, where platform is one of:
|
||||
|
||||
- linux, for machines running Linux
|
||||
- win32-vc, for Windows machines, compiling with a Microsoft compiler
|
||||
@@ -82,13 +81,12 @@
|
||||
- darwin, for OS X machines
|
||||
(TBD: add cygwin, solaris and freebsd support)
|
||||
|
||||
These files you will normally not change. If you need to override a
|
||||
default value, make a file called $BLENDERHOME/user-config.py, and copy
|
||||
settings from the build_files/scons/config/(platform)-config.py that you
|
||||
want to change. Don't copy the entire file (unless explicitly stated in
|
||||
the configuration file), because you may not get updated options you don't
|
||||
change yourself, which may result in build errors. You should NEVER have
|
||||
to modify $BLENDERHOME/build_files/scons/config/(platform)-config.py.
|
||||
These files you will normally not change. If you need to override
|
||||
a default value, make a file called $BLENDERHOME/user-config.py, and copy
|
||||
settings from the config/(platform)-config.py that you want to change. Don't
|
||||
copy the entire file (unless explicitely stated in the configuration file),
|
||||
because you may not get updated options you don't change yourself, which may
|
||||
result in build errors.
|
||||
|
||||
You can use BF_CONFIG argument to override the default user-config.py
|
||||
check. This is just like the user-config.py, but just with another name:
|
||||
@@ -115,6 +113,11 @@
|
||||
(unless you have overridden any of them in your
|
||||
$BLENDERHOME/user-config.py).
|
||||
|
||||
NOTE: The best way to avoid confusion is the
|
||||
copy $BLENDERHOME/config/(platform)-config.py to
|
||||
$BLENDERHOME/user-config.py. You should NEVER have to modify
|
||||
$BLENDERHOME/config/(platform)-config.py
|
||||
|
||||
Configuring the output
|
||||
----------------------
|
||||
|
||||
|
@@ -34,7 +34,7 @@ PROJECT_NAME = Blender
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER = "V2.7x"
|
||||
PROJECT_NUMBER = "V2.6x"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer
|
||||
|
@@ -7,7 +7,7 @@
|
||||
* These pages document the source code of blender.
|
||||
*
|
||||
* \subsection implinks Important Links
|
||||
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker
|
||||
* - <a href="http://projects.blender.org">projects.blender.org</a> with <a href="http://projects.blender.org/tracker/index.php?group_id=9&atid=498">bug tracker</a>
|
||||
* - <a href="http://wiki.blender.org/index.php/Dev:Contents">Development documents</a> on our wiki.
|
||||
*
|
||||
* \subsection blother Other
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/python
|
||||
|
||||
# ##### BEGIN GPL LICENSE BLOCK #####
|
||||
#
|
||||
|
@@ -7,7 +7,7 @@ A mix-in parent class can be used to share common properties and
|
||||
import bpy
|
||||
|
||||
|
||||
class View3DPanel:
|
||||
class View3DPanel():
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
|
@@ -21,12 +21,3 @@ print(quat_out)
|
||||
print("%.2f, %.2f, %.2f" % tuple(math.degrees(a) for a in quat_out.to_euler()))
|
||||
print("(%.2f, %.2f, %.2f), %.2f" % (quat_out.axis[:] +
|
||||
(math.degrees(quat_out.angle), )))
|
||||
|
||||
# multiple rotations can be interpolated using the exponential map
|
||||
quat_c = mathutils.Quaternion((1.0, 0.0, 0.0), math.radians(15.0))
|
||||
exp_avg = (quat_a.to_exponential_map() +
|
||||
quat_b.to_exponential_map() +
|
||||
quat_c.to_exponential_map()) / 3.0
|
||||
quat_avg = mathutils.Quaternion(exp_avg)
|
||||
print("Average rotation:")
|
||||
print(quat_avg)
|
||||
|
@@ -18,16 +18,16 @@ matrix = mathutils.Matrix()
|
||||
|
||||
# Comparison operators can be done on Vector classes:
|
||||
|
||||
# (In)equality operators == and != test component values, e.g. 1,2,3 != 3,2,1
|
||||
vec_a == vec_b
|
||||
vec_a != vec_b
|
||||
|
||||
# Ordering operators >, >=, > and <= test vector length.
|
||||
# greater and less then test vector length.
|
||||
vec_a > vec_b
|
||||
vec_a >= vec_b
|
||||
vec_a < vec_b
|
||||
vec_a <= vec_b
|
||||
|
||||
# ==, != test vector values e.g. 1,2,3 != 3,2,1 even if they are the same length
|
||||
vec_a == vec_b
|
||||
vec_a != vec_b
|
||||
|
||||
|
||||
# Math can be performed on Vector classes
|
||||
vec_a + vec_b
|
||||
|
@@ -8,13 +8,9 @@ Intro
|
||||
|
||||
.. module:: bge.render
|
||||
|
||||
Example of using a :class:`bge.types.SCA_MouseSensor`, and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
|
||||
|
||||
.. note::
|
||||
This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook::
|
||||
# To use a mouse movement sensor "Mouse" and a
|
||||
# motion actuator to mouse look:
|
||||
import bge
|
||||
@@ -66,7 +62,7 @@ Constants
|
||||
.. data:: KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
Materials approximating blender materials with GLSL.
|
||||
|
||||
|
||||
.. DATA:: VSYNC_OFF
|
||||
|
||||
Disables vsync
|
||||
@@ -79,15 +75,6 @@ Constants
|
||||
|
||||
Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low.
|
||||
|
||||
.. data:: LEFT_EYE
|
||||
|
||||
Left eye being used during stereoscopic rendering.
|
||||
|
||||
.. data:: RIGHT_EYE
|
||||
|
||||
Right eye being used during stereoscopic rendering.
|
||||
|
||||
|
||||
*********
|
||||
Functions
|
||||
*********
|
||||
@@ -95,49 +82,47 @@ Functions
|
||||
.. function:: getWindowWidth()
|
||||
|
||||
Gets the width of the window (in pixels)
|
||||
|
||||
|
||||
:rtype: integer
|
||||
|
||||
.. function:: getWindowHeight()
|
||||
|
||||
Gets the height of the window (in pixels)
|
||||
|
||||
|
||||
:rtype: integer
|
||||
|
||||
.. function:: setWindowSize(width, height)
|
||||
|
||||
Set the width and height of the window (in pixels). This also works for fullscreen applications.
|
||||
|
||||
|
||||
:type width: integer
|
||||
:type height: integer
|
||||
|
||||
.. function:: setFullScreen(enable)
|
||||
|
||||
Set whether or not the window should be fullscreen.
|
||||
|
||||
|
||||
:type enable: bool
|
||||
|
||||
.. function:: getFullScreen()
|
||||
|
||||
Returns whether or not the window is fullscreen.
|
||||
|
||||
|
||||
:rtype: bool
|
||||
|
||||
.. function:: makeScreenshot(filename)
|
||||
|
||||
Writes an image file with the current displayed frame.
|
||||
|
||||
The image is written to *'filename'*. The path may be absolute (eg. "/home/foo/image") or relative when started with
|
||||
"//" (eg. "//image"). Note that absolute paths are not portable between platforms.
|
||||
If the filename contains a "#", it will be replaced by an incremental index so that screenshots can be taken multiple
|
||||
times without overwriting the previous ones (eg. "image-#").
|
||||
|
||||
Settings for the image are taken from the render settings (file format and respective settings, gamma and colospace
|
||||
conversion, etc). The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
|
||||
When running from the standalone player, instead of the embedded player, only PNG files are supported. Additional
|
||||
color conversions are also not supported.
|
||||
|
||||
:arg filename: path and name of the file to write
|
||||
Writes a screenshot to the given filename.
|
||||
|
||||
If filename starts with // the image will be saved relative to the current directory.
|
||||
If the filename contains # it will be replaced with the frame number.
|
||||
|
||||
The standalone player saves .png files. It does not support color space conversion
|
||||
or gamma correction.
|
||||
|
||||
When run from Blender, makeScreenshot supports all Blender image file formats like PNG, TGA, Jpeg and OpenEXR.
|
||||
Gamma, Colorspace conversion and Jpeg compression are taken from the Render settings panels.
|
||||
|
||||
:type filename: string
|
||||
|
||||
|
||||
@@ -149,29 +134,65 @@ Functions
|
||||
.. function:: showMouse(visible)
|
||||
|
||||
Enables or disables the operating system mouse cursor.
|
||||
|
||||
|
||||
:type visible: boolean
|
||||
|
||||
|
||||
.. function:: setMousePosition(x, y)
|
||||
|
||||
Sets the mouse cursor position.
|
||||
|
||||
|
||||
:type x: integer
|
||||
:type y: integer
|
||||
|
||||
|
||||
.. function:: setBackgroundColor(rgba)
|
||||
|
||||
Sets the window background color. (Deprecated: use KX_WorldInfo.background_color)
|
||||
|
||||
Sets the window background color.
|
||||
|
||||
:type rgba: list [r, g, b, a]
|
||||
|
||||
|
||||
.. function:: setMistColor(rgb)
|
||||
|
||||
Sets the mist color.
|
||||
|
||||
:type rgb: list [r, g, b]
|
||||
|
||||
|
||||
.. function:: setAmbientColor(rgb)
|
||||
|
||||
Sets the color of ambient light.
|
||||
|
||||
:type rgb: list [r, g, b]
|
||||
|
||||
|
||||
.. function:: setMistStart(start)
|
||||
|
||||
Sets the mist start value. Objects further away than start will have mist applied to them.
|
||||
|
||||
:type start: float
|
||||
|
||||
|
||||
.. function:: setMistEnd(end)
|
||||
|
||||
Sets the mist end value. Objects further away from this will be colored solid with
|
||||
the color set by setMistColor().
|
||||
|
||||
:type end: float
|
||||
|
||||
|
||||
.. function:: disableMist()
|
||||
|
||||
Disables mist.
|
||||
|
||||
.. note:: Set any of the mist properties to enable mist.
|
||||
|
||||
|
||||
.. function:: setEyeSeparation(eyesep)
|
||||
|
||||
Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
|
||||
|
||||
|
||||
:arg eyesep: The distance between the left and right eye.
|
||||
:type eyesep: float
|
||||
|
||||
@@ -179,36 +200,27 @@ Functions
|
||||
.. function:: getEyeSeparation()
|
||||
|
||||
Gets the current eye separation for stereo mode.
|
||||
|
||||
|
||||
:rtype: float
|
||||
|
||||
|
||||
|
||||
.. function:: setFocalLength(focallength)
|
||||
|
||||
Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
|
||||
|
||||
:arg focallength: The focal length.
|
||||
|
||||
:arg focallength: The focal length.
|
||||
:type focallength: float
|
||||
|
||||
.. function:: getFocalLength()
|
||||
|
||||
Gets the current focal length for stereo mode.
|
||||
|
||||
|
||||
:rtype: float
|
||||
|
||||
.. function:: getStereoEye()
|
||||
|
||||
Gets the current stereoscopy eye being rendered.
|
||||
This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback
|
||||
function to customize the camera projection matrices for each
|
||||
stereoscopic eye.
|
||||
|
||||
:rtype: LEFT_EYE, RIGHT_EYE
|
||||
|
||||
.. function:: setMaterialMode(mode)
|
||||
|
||||
Set the material mode to use for OpenGL rendering.
|
||||
|
||||
|
||||
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
.. note:: Changes will only affect newly created scenes.
|
||||
@@ -217,14 +229,14 @@ Functions
|
||||
.. function:: getMaterialMode(mode)
|
||||
|
||||
Get the material mode to use for OpenGL rendering.
|
||||
|
||||
|
||||
:rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
|
||||
|
||||
|
||||
.. function:: setGLSLMaterialSetting(setting, enable)
|
||||
|
||||
Enables or disables a GLSL material setting.
|
||||
|
||||
|
||||
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
|
||||
:type enable: boolean
|
||||
|
||||
@@ -232,43 +244,43 @@ Functions
|
||||
.. function:: getGLSLMaterialSetting(setting, enable)
|
||||
|
||||
Get the state of a GLSL material setting.
|
||||
|
||||
|
||||
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
|
||||
:rtype: boolean
|
||||
|
||||
.. function:: setAnisotropicFiltering(level)
|
||||
|
||||
Set the anisotropic filtering level for textures.
|
||||
|
||||
|
||||
:arg level: The new anisotropic filtering level to use
|
||||
:type level: integer (must be one of 1, 2, 4, 8, 16)
|
||||
|
||||
|
||||
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
|
||||
|
||||
|
||||
.. function:: getAnisotropicFiltering()
|
||||
|
||||
Get the anisotropic filtering level used for textures.
|
||||
|
||||
|
||||
:rtype: integer (one of 1, 2, 4, 8, 16)
|
||||
|
||||
.. function:: setMipmapping(value)
|
||||
|
||||
Change how to use mipmapping.
|
||||
|
||||
|
||||
:type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
|
||||
|
||||
|
||||
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
|
||||
|
||||
.. function:: getMipmapping()
|
||||
|
||||
Get the current mipmapping setting.
|
||||
|
||||
|
||||
:rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
|
||||
|
||||
|
||||
.. function:: drawLine(fromVec,toVec,color)
|
||||
|
||||
Draw a line in the 3D scene.
|
||||
|
||||
|
||||
:arg fromVec: the origin of the line
|
||||
:type fromVec: list [x, y, z]
|
||||
:arg toVec: the end of the line
|
||||
@@ -280,7 +292,7 @@ Functions
|
||||
.. function:: enableMotionBlur(factor)
|
||||
|
||||
Enable the motion blur effect.
|
||||
|
||||
|
||||
:arg factor: the ammount of motion blur to display.
|
||||
:type factor: float [0.0 - 1.0]
|
||||
|
||||
|
@@ -37,7 +37,7 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. method:: jump()
|
||||
|
||||
|
@@ -78,33 +78,6 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
|
||||
|
||||
.. attribute:: isSuspendDynamics
|
||||
|
||||
The object's dynamic state (read-only).
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: linearDamping
|
||||
|
||||
The object's linear damping, also known as translational damping. Can be set simultaneously with angular damping using the :py:meth:`setDamping` method.
|
||||
|
||||
:type: float between 0 and 1 inclusive.
|
||||
|
||||
.. note::
|
||||
|
||||
The object must have a physics controller for the linear damping to be applied, otherwise the value will be returned as 0.0.
|
||||
|
||||
.. attribute:: angularDamping
|
||||
|
||||
The object's angular damping, also known as rotationation damping. Can be set simultaneously with linear damping using the :py:meth:`setDamping` method.
|
||||
|
||||
:type: float between 0 and 1 inclusive.
|
||||
|
||||
.. note::
|
||||
|
||||
The object must have a physics controller for the angular damping to be applied, otherwise the value will be returned as 0.0.
|
||||
|
||||
|
||||
.. attribute:: linVelocityMin
|
||||
|
||||
Enforces the object keeps moving at a minimum velocity.
|
||||
@@ -141,7 +114,7 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
the object's inertia vector in local coordinates. Read only.
|
||||
|
||||
:type: Vector((ix, iy, iz))
|
||||
:type: list [ix, iy, iz]
|
||||
|
||||
.. attribute:: parent
|
||||
|
||||
@@ -151,58 +124,21 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
.. attribute:: groupMembers
|
||||
|
||||
Returns the list of group members if the object is a group object (dupli group instance), otherwise None is returned.
|
||||
Returns the list of group members if the object is a group object, otherwise None is returned.
|
||||
|
||||
:type: :class:`CListValue` of :class:`KX_GameObject` or None
|
||||
|
||||
.. attribute:: groupObject
|
||||
|
||||
Returns the group object (dupli group instance) that the object belongs to or None if the object is not part of a group.
|
||||
Returns the group object that the object belongs to or None if the object is not part of a group.
|
||||
|
||||
:type: :class:`KX_GameObject` or None
|
||||
|
||||
.. attribute:: collisionCallbacks
|
||||
|
||||
A list of functions to be called when a collision occurs.
|
||||
A list of callables to be run when a collision occurs.
|
||||
|
||||
:type: list of functions and/or methods
|
||||
|
||||
Callbacks should either accept one argument `(object)`, or three
|
||||
arguments `(object, point, normal)`. For simplicity, per
|
||||
colliding object only the first collision point is reported.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Function form
|
||||
def callback_three(object, point, normal):
|
||||
print('Hit by %r at %s with normal %s' % (object.name, point, normal))
|
||||
|
||||
def callback_one(object):
|
||||
print('Hit by %r' % object.name)
|
||||
|
||||
def register_callback(controller):
|
||||
controller.owner.collisionCallbacks.append(callback_three)
|
||||
controller.owner.collisionCallbacks.append(callback_one)
|
||||
|
||||
|
||||
# Method form
|
||||
class YourGameEntity(bge.types.KX_GameObject):
|
||||
def __init__(self, old_owner):
|
||||
self.collisionCallbacks.append(self.on_collision_three)
|
||||
self.collisionCallbacks.append(self.on_collision_one)
|
||||
|
||||
def on_collision_three(self, object, point, normal):
|
||||
print('Hit by %r at %s with normal %s' % (object.name, point, normal))
|
||||
|
||||
def on_collision_one(self, object):
|
||||
print('Hit by %r' % object.name)
|
||||
|
||||
.. note::
|
||||
For backward compatibility, a callback with variable number of
|
||||
arguments (using `*args`) will be passed only the `object`
|
||||
argument. Only when there is more than one fixed argument (not
|
||||
counting `self` for methods) will the three-argument form be
|
||||
used.
|
||||
:type: list
|
||||
|
||||
.. attribute:: scene
|
||||
|
||||
@@ -438,12 +374,6 @@ base class --- :class:`SCA_IObject`
|
||||
If true, the object's and children's debug properties will be displayed on screen.
|
||||
|
||||
:type: boolean
|
||||
|
||||
.. attribute:: currentLodLevel
|
||||
|
||||
The index of the level of detail (LOD) currently used by this object (read-only).
|
||||
|
||||
:type: int
|
||||
|
||||
.. method:: endObject()
|
||||
|
||||
@@ -566,7 +496,7 @@ base class --- :class:`SCA_IObject`
|
||||
* True: you get the "local" velocity ie: relative to object orientation.
|
||||
:type local: boolean
|
||||
:return: the object's linear velocity.
|
||||
:rtype: Vector((vx, vy, vz))
|
||||
:rtype: list [vx, vy, vz]
|
||||
|
||||
.. method:: setLinearVelocity(velocity, local=False)
|
||||
|
||||
@@ -593,7 +523,7 @@ base class --- :class:`SCA_IObject`
|
||||
* True: you get the "local" velocity ie: relative to object orientation.
|
||||
:type local: boolean
|
||||
:return: the object's angular velocity.
|
||||
:rtype: Vector((vx, vy, vz))
|
||||
:rtype: list [vx, vy, vz]
|
||||
|
||||
.. method:: setAngularVelocity(velocity, local=False)
|
||||
|
||||
@@ -617,7 +547,7 @@ base class --- :class:`SCA_IObject`
|
||||
:arg point: optional point to return the velocity for, in local coordinates.
|
||||
:type point: 3D Vector
|
||||
:return: the velocity at the specified point.
|
||||
:rtype: Vector((vx, vy, vz))
|
||||
:rtype: list [vx, vy, vz]
|
||||
|
||||
.. method:: getReactionForce()
|
||||
|
||||
@@ -627,7 +557,7 @@ base class --- :class:`SCA_IObject`
|
||||
This also includes impulses, eg from collisions.
|
||||
|
||||
:return: the reaction force of this object.
|
||||
:rtype: Vector((fx, fy, fz))
|
||||
:rtype: list [fx, fy, fz]
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -650,15 +580,6 @@ base class --- :class:`SCA_IObject`
|
||||
* True: you get the "local" impulse ie: relative to local coordinates with object orientation.
|
||||
:type local: boolean
|
||||
|
||||
.. method:: setDamping(linear_damping, angular_damping)
|
||||
|
||||
Sets both the :py:attr:`linearDamping` and :py:attr:`angularDamping` simultaneously. This is more efficient than setting both properties individually.
|
||||
|
||||
:arg linear_damping: Linear ("translational") damping factor.
|
||||
:type linear_damping: float ∈ [0, 1]
|
||||
:arg angular_damping: Angular ("rotational") damping factor.
|
||||
:type angular_damping: float ∈ [0, 1]
|
||||
|
||||
.. method:: suspendDynamics()
|
||||
|
||||
Suspends physics for this object.
|
||||
@@ -955,4 +876,4 @@ base class --- :class:`SCA_IObject`
|
||||
:arg name: name of the property that added to the debug list.
|
||||
:type name: string
|
||||
:arg debug: the debug state.
|
||||
:type debug: boolean
|
||||
:type debug: boolean
|
@@ -15,7 +15,7 @@ base class --- :class:`SCA_IActuator`
|
||||
|
||||
The force applied by the actuator.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. attribute:: useLocalForce
|
||||
|
||||
@@ -27,7 +27,7 @@ base class --- :class:`SCA_IActuator`
|
||||
|
||||
The torque applied by the actuator.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. attribute:: useLocalTorque
|
||||
|
||||
@@ -39,7 +39,7 @@ base class --- :class:`SCA_IActuator`
|
||||
|
||||
The displacement vector applied by the actuator.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. attribute:: useLocalDLoc
|
||||
|
||||
@@ -51,7 +51,7 @@ base class --- :class:`SCA_IActuator`
|
||||
|
||||
The angular displacement vector applied by the actuator
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -67,7 +67,7 @@ base class --- :class:`SCA_IActuator`
|
||||
|
||||
The linear velocity applied by the actuator.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. attribute:: useLocalLinV
|
||||
|
||||
@@ -83,7 +83,7 @@ base class --- :class:`SCA_IActuator`
|
||||
|
||||
The angular velocity applied by the actuator.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. attribute:: useLocalAngV
|
||||
|
||||
|
@@ -83,12 +83,6 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
|
||||
|
||||
.. attribute:: world
|
||||
|
||||
The current active world, (read-only).
|
||||
|
||||
:type: :class:`KX_WorldInfo`
|
||||
|
||||
.. attribute:: suspended
|
||||
|
||||
True if the scene is suspended, (read-only).
|
||||
@@ -129,7 +123,7 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
The scene gravity using the world x, y and z axis.
|
||||
|
||||
:type: Vector((gx, gy, gz))
|
||||
:type: list [fx, fy, fz]
|
||||
|
||||
.. method:: addObject(object, other, time=0)
|
||||
|
||||
|
@@ -11,25 +11,22 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
TODO - description
|
||||
|
||||
.. method:: addWheel(wheel, attachPos, downDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
|
||||
.. method:: addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
|
||||
|
||||
Add a wheel to the vehicle
|
||||
|
||||
:arg wheel: The object to use as a wheel.
|
||||
:type wheel: :class:`KX_GameObject` or a :class:`KX_GameObject` name
|
||||
:arg attachPos: The position to attach the wheel, relative to the chassis object center.
|
||||
:type wheel: :class:`KX_GameObject` or a KX_GameObject name
|
||||
:arg attachPos: The position that this wheel will attach to.
|
||||
:type attachPos: vector of 3 floats
|
||||
:arg downDir: The direction vector pointing down to where the vehicle should collide with the floor.
|
||||
:type downDir: vector of 3 floats
|
||||
:arg axleDir: The axis the wheel rotates around, relative to the chassis.
|
||||
:arg attachDir: The direction this wheel points.
|
||||
:type attachDir: vector of 3 floats
|
||||
:arg axleDir: The direction of this wheels axle.
|
||||
:type axleDir: vector of 3 floats
|
||||
:arg suspensionRestLength: The length of the suspension when no forces are being applied.
|
||||
:arg suspensionRestLength: TODO - Description
|
||||
:type suspensionRestLength: float
|
||||
:arg wheelRadius: The radius of the wheel (half the diameter).
|
||||
:arg wheelRadius: The size of the wheel.
|
||||
:type wheelRadius: float
|
||||
:arg hasSteering: True if the wheel should turn with steering, typically used in front wheels.
|
||||
:type hasSteering: boolean
|
||||
|
||||
|
||||
.. method:: applyBraking(force, wheelIndex)
|
||||
|
||||
@@ -41,7 +38,6 @@ base class --- :class:`PyObjectPlus`
|
||||
:arg wheelIndex: index of the wheel where the force needs to be applied
|
||||
:type wheelIndex: integer
|
||||
|
||||
|
||||
.. method:: applyEngineForce(force, wheelIndex)
|
||||
|
||||
Apply an engine force to the specified wheel
|
||||
@@ -52,7 +48,6 @@ base class --- :class:`PyObjectPlus`
|
||||
:arg wheelIndex: index of the wheel where the force needs to be applied
|
||||
:type wheelIndex: integer
|
||||
|
||||
|
||||
.. method:: getConstraintId()
|
||||
|
||||
Get the constraint ID
|
||||
|
@@ -17,25 +17,25 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
The position of the vertex.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
.. attribute:: UV
|
||||
|
||||
The texture coordinates of the vertex.
|
||||
|
||||
:type: Vector((u, v))
|
||||
:type: list [u, v]
|
||||
|
||||
.. attribute:: normal
|
||||
|
||||
The normal of the vertex.
|
||||
|
||||
:type: Vector((nx, ny, nz))
|
||||
:type: list [nx, ny, nz]
|
||||
|
||||
.. attribute:: color
|
||||
|
||||
The color of the vertex.
|
||||
|
||||
:type: Vector((r, g, b, a))
|
||||
:type: list [r, g, b, a]
|
||||
|
||||
Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
|
||||
|
||||
@@ -110,13 +110,13 @@ base class --- :class:`SCA_IObject`
|
||||
Gets the position of this vertex.
|
||||
|
||||
:return: this vertexes position in local coordinates.
|
||||
:rtype: Vector((x, y, z))
|
||||
:rtype: list [x, y, z]
|
||||
|
||||
.. method:: setXYZ(pos)
|
||||
|
||||
Sets the position of this vertex.
|
||||
|
||||
:type: Vector((x, y, z))
|
||||
:type: list [x, y, z]
|
||||
|
||||
:arg pos: the new position for this vertex in local coordinates.
|
||||
|
||||
@@ -125,26 +125,26 @@ base class --- :class:`SCA_IObject`
|
||||
Gets the UV (texture) coordinates of this vertex.
|
||||
|
||||
:return: this vertexes UV (texture) coordinates.
|
||||
:rtype: Vector((u, v))
|
||||
:rtype: list [u, v]
|
||||
|
||||
.. method:: setUV(uv)
|
||||
|
||||
Sets the UV (texture) coordinates of this vertex.
|
||||
|
||||
:type: Vector((u, v))
|
||||
:type: list [u, v]
|
||||
|
||||
.. method:: getUV2()
|
||||
|
||||
Gets the 2nd UV (texture) coordinates of this vertex.
|
||||
|
||||
:return: this vertexes UV (texture) coordinates.
|
||||
:rtype: Vector((u, v))
|
||||
:rtype: list [u, v]
|
||||
|
||||
.. method:: setUV2(uv, unit)
|
||||
|
||||
Sets the 2nd UV (texture) coordinates of this vertex.
|
||||
|
||||
:type: Vector((u, v))
|
||||
:type: list [u, v]
|
||||
|
||||
:arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
|
||||
:arg unit: integer
|
||||
@@ -197,7 +197,7 @@ base class --- :class:`SCA_IObject`
|
||||
Gets the normal vector of this vertex.
|
||||
|
||||
:return: normalized normal vector.
|
||||
:rtype: Vector((nx, ny, nz))
|
||||
:rtype: list [nx, ny, nz]
|
||||
|
||||
.. method:: setNormal(normal)
|
||||
|
||||
|
@@ -1,87 +0,0 @@
|
||||
KX_WordlInfo(PyObjectPlus)
|
||||
=============================
|
||||
|
||||
.. module:: bge.types
|
||||
|
||||
base class --- :class:`PyObjectPlus`
|
||||
|
||||
.. class:: KX_WorldInfo(PyObjectPlus)
|
||||
|
||||
A wolrd object.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# Set the mist color to red.
|
||||
import bge
|
||||
|
||||
sce = bge.logic.getCurrentScene()
|
||||
|
||||
sce.world.mist_color = [1.0, 0.0, 0.0]
|
||||
|
||||
*********
|
||||
Constants
|
||||
*********
|
||||
|
||||
.. data:: KX_MIST_QUADRATIC
|
||||
|
||||
Type of quadratic attenuation used to fade mist.
|
||||
|
||||
.. data:: KX_MIST_LINEAR
|
||||
|
||||
Type of linear attenuation used to fade mist.
|
||||
|
||||
.. data:: KX_MIST_INV_QUADRATIC
|
||||
|
||||
Type of inverse quadratic attenuation used to fade mist.
|
||||
|
||||
**********
|
||||
Attributes
|
||||
**********
|
||||
|
||||
.. attribute:: mist_enable
|
||||
|
||||
Return the state of the mist.
|
||||
|
||||
:type: bool
|
||||
|
||||
.. attribute:: mist_start
|
||||
|
||||
The mist start point.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: mist_distance
|
||||
|
||||
The mist distance fom the start point to reach 100% mist.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: mist_intensity
|
||||
|
||||
The mist intensity.
|
||||
|
||||
:type: float
|
||||
|
||||
.. attribute:: mist_type
|
||||
|
||||
The type of mist - must be KX_MIST_QUADRATIC, KX_MIST_LINEAR or KX_MIST_INV_QUADRATIC
|
||||
|
||||
.. attribute:: mist_color
|
||||
|
||||
The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
Mist and background color sould always set to the same color.
|
||||
|
||||
:type: :class:`mathutils.Vector`
|
||||
|
||||
.. attribute:: background_color
|
||||
|
||||
The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
Mist and background color sould always set to the same color.
|
||||
|
||||
:type: :class:`mathutils.Vector`
|
||||
|
||||
.. attribute:: ambient_color
|
||||
|
||||
The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
|
||||
|
||||
:type: :class:`mathutils.Vector`
|
@@ -25,7 +25,7 @@ base class --- :class:`PyObjectPlus`
|
||||
|
||||
The normalized x and y position of the mouse cursor.
|
||||
|
||||
:type: tuple (x, y)
|
||||
:type: list [x, y]
|
||||
|
||||
.. attribute:: visible
|
||||
|
||||
|
@@ -8,17 +8,19 @@ This module wraps OpenGL constants and functions, making them available from
|
||||
within Blender Python.
|
||||
|
||||
The complete list can be retrieved from the module itself, by listing its
|
||||
contents: dir(bgl). A simple search on the web can point to more
|
||||
contents: dir(bgl). A simple search on the net can point to more
|
||||
than enough material to teach OpenGL programming, from books to many
|
||||
collections of tutorials.
|
||||
|
||||
Here is a comprehensive `list of books <http://www.opengl.org/documentation/books/>`_ (non free). The `arcsynthesis tutorials <http://www.arcsynthesis.org/gltut/>`_ is one of the best resources to learn modern OpenGL and `g-truc <http://www.g-truc.net/post-tech-content-sample.html>`_ offers a set of extensive examples, including advanced features.
|
||||
|
||||
The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
|
||||
OpenGL}" and the online NeHe tutorials are two of the best resources.
|
||||
|
||||
.. note::
|
||||
You can use the :class:`Image` type to load and set textures.
|
||||
See :class:`Image.gl_load` and :class:`Image.gl_load`,
|
||||
for example.
|
||||
`OpenGL.org <http://www.opengl.org>`_
|
||||
`NeHe GameDev <http://nehe.gamedev.net>`_
|
||||
|
||||
|
||||
.. function:: glAccum(op, value):
|
||||
|
@@ -11,22 +11,32 @@ This API is generally stable but some areas are still being added and improved.
|
||||
|
||||
The Blender/Python API can do the following:
|
||||
|
||||
- Edit any data the user interface can (Scenes, Meshes, Particles etc.)
|
||||
- Modify user preferences, keymaps and themes
|
||||
- Run tools with own settings
|
||||
- Create user interface elements such as menus, headers and panels
|
||||
- Create new tools
|
||||
- Create interactive tools
|
||||
- Create new rendering engines that integrate with Blender
|
||||
- Define new settings in existing Blender data
|
||||
- Draw in the 3D view using OpenGL commands from Python
|
||||
* Edit any data the user interface can (Scenes, Meshes, Particles etc.)
|
||||
|
||||
* Modify user preferences, keymaps and themes
|
||||
|
||||
* Run tools with own settings
|
||||
|
||||
* Create user interface elements such as menus, headers and panels
|
||||
|
||||
* Create new tools
|
||||
|
||||
* Create interactive tools
|
||||
|
||||
* Create new rendering engines that integrate with Blender
|
||||
|
||||
* Define new settings in existing Blender data
|
||||
|
||||
* Draw in the 3D view using OpenGL commands from Python
|
||||
|
||||
|
||||
The Blender/Python API **can't** (yet)...
|
||||
|
||||
- Create new space types.
|
||||
- Assign custom properties to every type.
|
||||
- Define callbacks or listeners to be notified when data is changed.
|
||||
* Create new space types.
|
||||
|
||||
* Assign custom properties to every type.
|
||||
|
||||
* Define callbacks or listeners to be notified when data is changed.
|
||||
|
||||
|
||||
Before Starting
|
||||
@@ -37,21 +47,23 @@ This document isn't intended to fully cover each topic. Rather, its purpose is t
|
||||
|
||||
A quick list of helpful things to know before starting:
|
||||
|
||||
- Blender uses Python 3.x; some online documentation still assumes 2.x.
|
||||
- The interactive console is great for testing one-liners, It also has autocompletion so you can inspect the API quickly.
|
||||
- Button tool tips show Python attributes and operator names.
|
||||
- Right clicking on buttons and menu items directly links to API documentation.
|
||||
- For more examples, the text menu has a templates section where some example operators can be found.
|
||||
- To examine further scripts distributed with Blender, see:
|
||||
* Blender uses Python 3.x; some 3rd party extensions are not available yet.
|
||||
|
||||
| ``~/.blender/scripts/startup/bl_ui`` for the user interface,
|
||||
| ``~/.blender/scripts/startup/bl_op`` for operators.
|
||||
* The interactive console is great for testing one-liners, It also has autocompletion so you can inspect the api quickly.
|
||||
|
||||
* Button tool tips show Python attributes and operator names.
|
||||
|
||||
* Right clicking on buttons and menu items directly links to API documentation.
|
||||
|
||||
* For more examples, the text menu has a templates section where some example operators can be found.
|
||||
|
||||
* To examine further scripts distributed with Blender, see ``~/.blender/scripts/startup/bl_ui`` for the user interface and ``~/.blender/scripts/startup/bl_op`` for operators.
|
||||
|
||||
|
||||
Running Scripts
|
||||
---------------
|
||||
|
||||
The two most common ways to execute Python scripts are using the built-in text editor or entering commands in the Python console.
|
||||
The two most common ways to execute python scripts are using the built-in text editor or entering commands in the python console.
|
||||
|
||||
Both the **Text Editor** and **Python Console** are space types you can select from the view header.
|
||||
|
||||
@@ -70,7 +82,7 @@ Key Concepts
|
||||
Data Access
|
||||
-----------
|
||||
|
||||
Accessing DataBlocks
|
||||
Accessing datablocks
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Python accesses Blender's data in the same way as the animation system and user interface; this implies that any setting that can be changed via a button can also be changed from Python.
|
||||
@@ -104,7 +116,7 @@ Unlike Python's dictionaries, both methods are acceptable; however, the index of
|
||||
bpy.data.objects["Cube"]
|
||||
|
||||
|
||||
Accessing Attributes
|
||||
Accessing attributes
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Once you have a data block, such as a material, object, groups etc., its attributes can be accessed much like you would change a setting using the graphical interface. In fact, the tooltip for each button also displays the Python attribute which can help in finding what settings to change in a script.
|
||||
@@ -132,7 +144,7 @@ Example of a data path that can be quickly found via the console:
|
||||
Data Creation/Removal
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Those of you familiar with other Python API's may be surprised that new datablocks in the bpy API can't be created by calling the class:
|
||||
Those of you familiar with other python api's may be surprised that new datablocks in the bpy api can't be created by calling the class:
|
||||
|
||||
>>> bpy.types.Mesh()
|
||||
Traceback (most recent call last):
|
||||
@@ -141,9 +153,9 @@ Those of you familiar with other Python API's may be surprised that new databloc
|
||||
|
||||
|
||||
This is an intentional part of the API design.
|
||||
The Blender/Python API can't create Blender data that exists outside the main Blender database (accessed through :mod:`bpy.data`), because this data is managed by Blender (save/load/undo/append... etc).
|
||||
The blender/python api can't create blender data that exists outside the main blender database (accessed through bpy.data), because this data is managed by blender (save/load/undo/append... etc).
|
||||
|
||||
Data is added and removed via methods on the collections in :mod:`bpy.data`, eg:
|
||||
Data is added and removed via methods on the collections in bpy.data, eg:
|
||||
|
||||
>>> mesh = bpy.data.meshes.new(name="MyMesh")
|
||||
>>> print(mesh)
|
||||
@@ -155,8 +167,7 @@ Data is added and removed via methods on the collections in :mod:`bpy.data`, eg:
|
||||
Custom Properties
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`.
|
||||
When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
|
||||
Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`. When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
|
||||
|
||||
This data is saved with the blend file and copied with objects.
|
||||
|
||||
@@ -169,7 +180,7 @@ Example:
|
||||
if "SomeProp" in bpy.context.object:
|
||||
print("Property found")
|
||||
|
||||
# Use the get function like a Python dictionary
|
||||
# Use the get function like a python dictionary
|
||||
# which can have a fallback value.
|
||||
value = bpy.data.scenes["Scene"].get("test_prop", "fallback value")
|
||||
|
||||
@@ -182,9 +193,11 @@ Example:
|
||||
|
||||
Note that these properties can only be assigned basic Python types.
|
||||
|
||||
- int, float, string
|
||||
- array of ints/floats
|
||||
- dictionary (only string keys are supported, values must be basic types too)
|
||||
* int, float, string
|
||||
|
||||
* array of ints/floats
|
||||
|
||||
* dictionary (only string keys are supported, values must be basic types too)
|
||||
|
||||
These properties are valid outside of Python. They can be animated by curves or used in driver paths.
|
||||
|
||||
@@ -192,8 +205,7 @@ These properties are valid outside of Python. They can be animated by curves or
|
||||
Context
|
||||
-------
|
||||
|
||||
While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection.
|
||||
The context is always available from ``bpy.context`` and can be used to get the active object, scene, tool settings along with many other attributes.
|
||||
While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection. The context is always available from '''bpy.context''' and can be used to get the active object, scene, tool settings along with many other attributes.
|
||||
|
||||
Common-use cases:
|
||||
|
||||
@@ -208,10 +220,9 @@ So ``bpy.context.object = obj`` will raise an error.
|
||||
But ``bpy.context.scene.objects.active = obj`` will work as expected.
|
||||
|
||||
|
||||
The context attributes change depending on where they are accessed.
|
||||
The 3D view has different context members than the console, so take care when accessing context attributes that the user state is known.
|
||||
The context attributes change depending on where they are accessed. The 3D view has different context members than the console, so take care when accessing context attributes that the user state is known.
|
||||
|
||||
See :mod:`bpy.context` API reference.
|
||||
See :mod:`bpy.context` API reference
|
||||
|
||||
|
||||
Operators (Tools)
|
||||
@@ -230,17 +241,16 @@ Examples:
|
||||
|
||||
.. note::
|
||||
|
||||
The menu item: :menuselection:`Help --> Operator Cheat Sheet` gives a list of all operators and their default values in Python syntax, along with the generated docs.
|
||||
This is a good way to get an overview of all Blender's operators.
|
||||
The menu item: Help -> Operator Cheat Sheet" gives a list of all operators and their default values in Python syntax, along with the generated docs. This is a good way to get an overview of all blender's operators.
|
||||
|
||||
|
||||
Operator Poll()
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Many operators have a "poll" function which may check that the mouse is in a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc).
|
||||
When an operator's poll function fails within Python, an exception is raised.
|
||||
When an operator's poll function fails within python, an exception is raised.
|
||||
|
||||
For example, calling ``bpy.ops.view3d.render_border()`` from the console raises the following error:
|
||||
For example, calling bpy.ops.view3d.render_border() from the console raises the following error:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -261,10 +271,13 @@ Integration
|
||||
|
||||
Python scripts can integrate with Blender in the following ways:
|
||||
|
||||
- By defining a rendering engine.
|
||||
- By defining operators.
|
||||
- By defining menus, headers and panels.
|
||||
- By inserting new buttons into existing menus, headers and panels
|
||||
* By defining a rendering engine.
|
||||
|
||||
* By defining operators.
|
||||
|
||||
* By defining menus, headers and panels.
|
||||
|
||||
* By inserting new buttons into existing menus, headers and panels
|
||||
|
||||
|
||||
In Python, this is done by defining a class, which is a subclass of an existing type.
|
||||
@@ -279,17 +292,24 @@ Once this script runs, ``SimpleOperator`` is registered with Blender and can be
|
||||
|
||||
To run the script:
|
||||
|
||||
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it.
|
||||
#. Highlight the above code then press Ctrl+C to copy it.
|
||||
|
||||
#. Start Blender
|
||||
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout.
|
||||
|
||||
#. Press Ctrl+Right twice to change to the Scripting layout.
|
||||
|
||||
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
|
||||
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame).
|
||||
|
||||
#. Press Ctrl+V to paste the code into the text panel (the upper left frame).
|
||||
|
||||
#. Click on the button **Run Script**.
|
||||
|
||||
#. Move your mouse into the 3D view, press spacebar for the operator search menu, and type "Simple".
|
||||
|
||||
#. Click on the "Simple Operator" item found in search.
|
||||
|
||||
|
||||
.. seealso:: The class members with the ``bl_`` prefix are documented in the API
|
||||
.. seealso:: The class members with the **bl_** prefix are documented in the API
|
||||
reference :class:`bpy.types.Operator`
|
||||
|
||||
.. note:: The output from the ``main`` function is sent to the terminal; in order to see this, be sure to :ref:`use the terminal <use_the_terminal>`.
|
||||
@@ -297,25 +317,33 @@ To run the script:
|
||||
Example Panel
|
||||
-------------
|
||||
|
||||
Panels register themselves as a class, like an operator. Notice the extra ``bl_`` variables used to set the context they display in.
|
||||
Panels register themselves as a class, like an operator. Notice the extra **bl_** variables used to set the context they display in.
|
||||
|
||||
.. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py
|
||||
|
||||
To run the script:
|
||||
|
||||
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it
|
||||
#. Highlight the above code then press Ctrl+C to copy it
|
||||
|
||||
#. Start Blender
|
||||
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout
|
||||
|
||||
#. Press Ctrl+Right twice to change to the Scripting layout
|
||||
|
||||
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
|
||||
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame)
|
||||
|
||||
#. Press Ctrl+V to paste the code into the text panel (the upper left frame)
|
||||
|
||||
#. Click on the button **Run Script**.
|
||||
|
||||
|
||||
To view the results:
|
||||
|
||||
#. Select the the default cube.
|
||||
|
||||
#. Click on the Object properties icon in the buttons panel (far right; appears as a tiny cube).
|
||||
|
||||
#. Scroll down to see a panel named **Hello World Panel**.
|
||||
|
||||
#. Changing the object name also updates **Hello World Panel's** Name: field.
|
||||
|
||||
Note the row distribution and the label and properties that are available through the code.
|
||||
@@ -334,14 +362,16 @@ Blender's Python API can be split up into 3 categories.
|
||||
Native Types
|
||||
------------
|
||||
|
||||
In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal Python types.
|
||||
In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal python types.
|
||||
|
||||
- Blender float/int/boolean -> float/int/boolean
|
||||
- Blender enumerator -> string
|
||||
* blender float/int/boolean -> float/int/boolean
|
||||
|
||||
* blender enumerator -> string
|
||||
|
||||
>>> C.object.rotation_mode = 'AXIS_ANGLE'
|
||||
|
||||
- Blender enumerator (multiple) -> set of strings
|
||||
|
||||
* blender enumerator (multiple) -> set of strings
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -359,7 +389,7 @@ Used for Blender datablocks and collections: :class:`bpy.types.bpy_struct`
|
||||
|
||||
For data that contains its own attributes groups/meshes/bones/scenes... etc.
|
||||
|
||||
There are 2 main types that wrap Blenders data, one for datablocks (known internally as ``bpy_struct``), another for properties.
|
||||
There are 2 main types that wrap Blenders data, one for datablocks (known internally as bpy_struct), another for properties.
|
||||
|
||||
>>> bpy.context.object
|
||||
bpy.data.objects['Cube']
|
||||
|
@@ -19,17 +19,21 @@ Prerequisites
|
||||
|
||||
Before going through the tutorial you should...
|
||||
|
||||
- Familiarity with the basics of working in Blender.
|
||||
- Know how to run a script in Blender's text editor (as documented in the quick-start)
|
||||
- Have an understanding of Python primitive types (int, boolean, string, list, tuple, dictionary, and set).
|
||||
- Be familiar with the concept of Python modules.
|
||||
- Basic understanding of classes (object orientation) in Python.
|
||||
* Familiarity with the basics of working in Blender.
|
||||
|
||||
* Know how to run a script in Blender's text editor (as documented in the quick-start)
|
||||
|
||||
* Have an understanding of Python primitive types (int, boolean, string, list, tuple, dictionary, and set).
|
||||
|
||||
* Be familiar with the concept of Python modules.
|
||||
|
||||
* Basic understanding of classes (object orientation) in Python.
|
||||
|
||||
|
||||
Suggested reading before starting this tutorial.
|
||||
|
||||
- `Dive Into Python <http://getpython3.com/diveintopython3/index.html>`_ sections (1, 2, 3, 4, and 7).
|
||||
- :ref:`Blender API Quickstart <info_quickstart>`
|
||||
* `Dive Into Python <http://getpython3.com/diveintopython3/index.html>`_ sections (1, 2, 3, 4, and 7).
|
||||
* :ref:`Blender API Quickstart <info_quickstart>`
|
||||
to help become familiar with Blender/Python basics.
|
||||
|
||||
|
||||
@@ -41,11 +45,13 @@ Documentation Links
|
||||
|
||||
While going through the tutorial you may want to look into our reference documentation.
|
||||
|
||||
- :ref:`Blender API Overview <info_overview>`. -
|
||||
* :ref:`Blender API Overview <info_overview>`. -
|
||||
*This document is rather detailed but helpful if you want to know more on a topic.*
|
||||
- :mod:`bpy.context` api reference. -
|
||||
|
||||
* :mod:`bpy.context` api reference. -
|
||||
*Handy to have a list of available items your script may operate on.*
|
||||
- :class:`bpy.types.Operator`. -
|
||||
|
||||
* :class:`bpy.types.Operator`. -
|
||||
*The following addons define operators, these docs give details and more examples of operators.*
|
||||
|
||||
|
||||
@@ -72,11 +78,11 @@ To give an example, here is the simplest possible addon.
|
||||
print("Goodbye World")
|
||||
|
||||
|
||||
- ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the
|
||||
* ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the
|
||||
user preferences addon list.
|
||||
- ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without
|
||||
* ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without
|
||||
activating the addon.
|
||||
- ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled.
|
||||
* ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled.
|
||||
|
||||
|
||||
|
||||
@@ -178,15 +184,12 @@ This addon takes the body of the script above, and adds them to an operator's ``
|
||||
register()
|
||||
|
||||
|
||||
.. note::
|
||||
.. note:: ``bl_info`` is split across multiple lines, this is just a style convention used to more easily add items.
|
||||
|
||||
``bl_info`` is split across multiple lines, this is just a style convention used to more easily add items.
|
||||
|
||||
.. note::
|
||||
|
||||
Rather than using ``bpy.context.scene``, we use the ``context.scene`` argument passed to ``execute()``.
|
||||
In most cases these will be the same however in some cases operators will be passed a custom context
|
||||
so script authors should prefer the ``context`` argument passed to operators.
|
||||
.. note:: Rather than using ``bpy.context.scene``, we use the ``context.scene`` argument passed to ``execute()``.
|
||||
In most cases these will be the same however in some cases operators will be passed a custom context
|
||||
so script authors should prefer the ``context`` argument passed to operators.
|
||||
|
||||
|
||||
To test the script you can copy and paste this into Blender text editor and run it, this will execute the script
|
||||
directly and call register immediately.
|
||||
@@ -199,8 +202,8 @@ However running the script wont move any objects, for this you need to execute t
|
||||
:height: 574px
|
||||
:alt: Spacebar
|
||||
|
||||
Do this by pressing :kbd:`Spacebar` to bring up the operator search dialog and type in
|
||||
"Move X by One" (the ``bl_label``), then :kbd:`Enter`.
|
||||
Do this by pressing ``SpaceBar`` to bring up the operator search dialog and type in "Move X by One" (the ``bl_label``),
|
||||
then press ``Enter``.
|
||||
|
||||
|
||||
|
||||
@@ -211,8 +214,8 @@ The objects should move as before.
|
||||
Install The Addon
|
||||
-----------------
|
||||
|
||||
Once you have your addon within in Blender's text editor,
|
||||
you will want to be able to install it so it can be enabled in the user preferences to load on startup.
|
||||
Once you have your addon within in Blender's text editor, you will want to be able to install it so it can be enabled in
|
||||
the user preferences to load on startup.
|
||||
|
||||
Even though the addon above is a test, lets go through the steps anyway so you know how to do it for later.
|
||||
|
||||
@@ -630,12 +633,15 @@ you want to see example code for, this is a good place to start.
|
||||
|
||||
Here are some sites you might like to check on after completing this tutorial.
|
||||
|
||||
- :ref:`Blender/Python API Overview <info_overview>` -
|
||||
* :ref:`Blender/Python API Overview <info_overview>` -
|
||||
*For more background details on Blender/Python integration.*
|
||||
- `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
|
||||
|
||||
* `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
|
||||
*Great info for those who are still learning Python.*
|
||||
- `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
|
||||
|
||||
* `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
|
||||
*Blender Development, general information and helpful links.*
|
||||
- `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
|
||||
|
||||
* `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
|
||||
*forum where people ask Python development questions*
|
||||
|
||||
|
@@ -316,7 +316,7 @@ def main():
|
||||
|
||||
try:
|
||||
import argparse
|
||||
except ImportError:
|
||||
except:
|
||||
print("Old Blender, just dumping")
|
||||
api_dump()
|
||||
return
|
||||
|
@@ -937,16 +937,10 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
||||
fw(title_string(heading, heading_char))
|
||||
|
||||
# May need to be its own function
|
||||
fw(".. class:: %s\n\n" % type_name)
|
||||
if value.__doc__:
|
||||
if value.__doc__.startswith(".. class::"):
|
||||
fw(value.__doc__)
|
||||
else:
|
||||
fw(".. class:: %s\n\n" % type_name)
|
||||
write_indented_lines(" ", fw, value.__doc__, False)
|
||||
else:
|
||||
fw(".. class:: %s\n\n" % type_name)
|
||||
fw("\n")
|
||||
|
||||
write_indented_lines(" ", fw, value.__doc__, False)
|
||||
fw("\n")
|
||||
write_example_ref(" ", fw, module_name + "." + type_name)
|
||||
|
||||
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")]
|
||||
@@ -977,12 +971,10 @@ def pymodule2sphinx(basepath, module_name, module, title):
|
||||
context_type_map = {
|
||||
"active_base": ("ObjectBase", False),
|
||||
"active_bone": ("EditBone", False),
|
||||
"active_gpencil_frame": ("GreasePencilLayer", True),
|
||||
"active_gpencil_layer": ("GPencilLayer", True),
|
||||
"active_node": ("Node", False),
|
||||
"active_object": ("Object", False),
|
||||
"active_operator": ("Operator", False),
|
||||
"active_pose_bone": ("PoseBone", False),
|
||||
"active_node": ("Node", False),
|
||||
"armature": ("Armature", False),
|
||||
"bone": ("Bone", False),
|
||||
"brush": ("Brush", False),
|
||||
@@ -998,11 +990,7 @@ context_type_map = {
|
||||
"edit_object": ("Object", False),
|
||||
"edit_text": ("Text", False),
|
||||
"editable_bones": ("EditBone", True),
|
||||
"editable_gpencil_layers": ("GPencilLayer", True),
|
||||
"editable_gpencil_strokes": ("GPencilStroke", True),
|
||||
"fluid": ("FluidSimulationModifier", False),
|
||||
"gpencil_data": ("GreasePencel", False),
|
||||
"gpencil_data_owner": ("ID", False),
|
||||
"image_paint_object": ("Object", False),
|
||||
"lamp": ("Lamp", False),
|
||||
"lattice": ("Lattice", False),
|
||||
@@ -1042,7 +1030,6 @@ context_type_map = {
|
||||
"vertex_paint_object": ("Object", False),
|
||||
"visible_bases": ("ObjectBase", True),
|
||||
"visible_bones": ("EditBone", True),
|
||||
"visible_gpencil_layers": ("GPencilLayer", True),
|
||||
"visible_objects": ("Object", True),
|
||||
"visible_pose_bones": ("PoseBone", True),
|
||||
"weight_paint_object": ("Object", False),
|
||||
|
7
extern/CMakeLists.txt
vendored
7
extern/CMakeLists.txt
vendored
@@ -26,14 +26,11 @@
|
||||
# Otherwise we get warnings here that we cant fix in external projects
|
||||
remove_strict_flags()
|
||||
|
||||
add_subdirectory(colamd)
|
||||
add_subdirectory(rangetree)
|
||||
add_subdirectory(wcwidth)
|
||||
add_subdirectory(libmv)
|
||||
|
||||
if(WITH_OPENNL)
|
||||
add_subdirectory(colamd)
|
||||
endif()
|
||||
|
||||
if(WITH_BULLET)
|
||||
if(NOT WITH_SYSTEM_BULLET)
|
||||
add_subdirectory(bullet2)
|
||||
@@ -69,7 +66,7 @@ if(WITH_IMAGE_REDCODE)
|
||||
add_subdirectory(libredcode)
|
||||
endif()
|
||||
|
||||
if(WITH_LZO AND NOT WITH_SYSTEM_LZO)
|
||||
if(WITH_LZO)
|
||||
add_subdirectory(lzo)
|
||||
endif()
|
||||
|
||||
|
5
extern/bullet2/readme.txt
vendored
5
extern/bullet2/readme.txt
vendored
@@ -6,8 +6,3 @@ Erwin
|
||||
|
||||
Apply patches/convex_hull.patch to add access to the convex hull
|
||||
operation, used in the BMesh convex hull operator.
|
||||
|
||||
Documentation is available at:
|
||||
http://code.google.com/p/bullet/source/browse/trunk/Bullet_User_Manual.pdf
|
||||
and:
|
||||
https://github.com/bulletphysics/bullet3/tree/master/docs
|
||||
|
0
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
vendored
Normal file → Executable file
0
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp
vendored
Normal file → Executable file
0
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h
vendored
Normal file → Executable file
0
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h
vendored
Normal file → Executable file
2
extern/carve/bundle.sh
vendored
2
extern/carve/bundle.sh
vendored
@@ -105,6 +105,8 @@ blender_add_lib(extern_carve "\${SRC}" "\${INC}" "\${INC_SYS}")
|
||||
EOF
|
||||
|
||||
cat > SConscript << EOF
|
||||
#!/usr/bin/python
|
||||
|
||||
# NOTE: This file is automatically generated by bundle.sh script
|
||||
# If you're doing changes in this file, please update template
|
||||
# in that script too
|
||||
|
71
extern/libmv/CMakeLists.txt
vendored
71
extern/libmv/CMakeLists.txt
vendored
@@ -37,42 +37,13 @@ set(SRC
|
||||
libmv-capi.h
|
||||
)
|
||||
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/gflags/gflags
|
||||
third_party/glog/src
|
||||
third_party/ceres/include
|
||||
third_party/ceres/config
|
||||
../../intern/guardedalloc
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
${EIGEN3_INCLUDE_DIRS}
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
add_definitions(
|
||||
-DWITH_LIBMV_GUARDED_ALLOC
|
||||
-DGOOGLE_GLOG_DLL_DECL=
|
||||
-DLIBMV_NO_FAST_DETECTOR=
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
TEST_SHARED_PTR_SUPPORT()
|
||||
if(SHARED_PTR_FOUND)
|
||||
if(SHARED_PTR_TR1_MEMORY_HEADER)
|
||||
@@ -85,6 +56,20 @@ if(WITH_LIBMV)
|
||||
message(FATAL_ERROR "Unable to find shared_ptr.")
|
||||
endif()
|
||||
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
third_party/ceres/include
|
||||
third_party/ceres/config
|
||||
../../intern/guardedalloc
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
../Eigen3
|
||||
${PNG_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/autotrack.cc
|
||||
intern/camera_intrinsics.cc
|
||||
@@ -217,6 +202,17 @@ if(WITH_LIBMV)
|
||||
third_party/msinttypes/stdint.h
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GTESTS)
|
||||
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "" "")
|
||||
@@ -266,7 +262,7 @@ if(WITH_LIBMV)
|
||||
endif()
|
||||
|
||||
# make GLog a separate target, so it can be used for gtest as well.
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
|
||||
# We compile GLog together with GFlag so we don't worry about
|
||||
# adding extra lib to linker.
|
||||
set(GLOG_SRC
|
||||
@@ -307,9 +303,6 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
third_party/glog/src/windows/glog/log_severity.h
|
||||
third_party/glog/src/windows/port.h
|
||||
third_party/glog/src/windows/config.h
|
||||
|
||||
third_party/gflags/windows_port.cc
|
||||
third_party/gflags/windows_port.h
|
||||
)
|
||||
else()
|
||||
list(APPEND GLOG_SRC
|
||||
@@ -345,5 +338,13 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
)
|
||||
endif()
|
||||
|
||||
blender_add_lib(extern_glog "${GLOG_SRC}" "${INC}" "${INC_SYS}")
|
||||
set(GLOG_INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
)
|
||||
|
||||
set(GLOG_INC_SYS
|
||||
)
|
||||
|
||||
blender_add_lib(extern_glog "${GLOG_SRC}" "${GLOG_INC}" "${GLOG_INC_SYS}")
|
||||
endif()
|
||||
|
73
extern/libmv/ChangeLog
vendored
73
extern/libmv/ChangeLog
vendored
@@ -1,42 +1,3 @@
|
||||
commit 7d6020d2ec42c6cb2749bc891186b4880d26d40b
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Wed Dec 31 15:32:07 2014 +0500
|
||||
|
||||
Update GLog to latest upstream revision 143
|
||||
|
||||
Mainly to solve compilation error with demangle.cc.
|
||||
|
||||
commit 5dc746700eaf85cb674f0fb73ff3c1b49a7f6315
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Fri Dec 12 14:59:55 2014 +0500
|
||||
|
||||
Update GFlags to latest release 2.1.1
|
||||
|
||||
Main purpose of this (andsome of upcoming) update is to check if the
|
||||
upstream sources are useable without any modifications for us. And if
|
||||
not, then we'll need to consider moving some changes into upstream.
|
||||
|
||||
This commit contains an one-to-one copy of the upstream GFlags library
|
||||
and also changes namespace usage since it's changed in the upstream.
|
||||
|
||||
commit 6fe6d75f7e90e161b44643b953f058a3829a5247
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Sat Nov 1 02:53:36 2014 +0500
|
||||
|
||||
Libmv: Code cleanup, mixed class/struct in declaration/definition
|
||||
|
||||
commit d2a5f7953812d2d09765431b59c6c4ac72faf35b
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Oct 30 23:13:53 2014 +0500
|
||||
|
||||
Libmv: Support disabled color channels in tracking settings
|
||||
|
||||
This was never ported to a new tracking pipeline and now it's done using
|
||||
FrameAccessor::Transform routines. Quite striaghtforward, but i've changed
|
||||
order of grayscale conversion in blender side with call of transform callback.
|
||||
|
||||
This way it's much easier to perform rescaling in libmv side.
|
||||
|
||||
commit d976e034cdf74b34860e0632d7b29713f47c5756
|
||||
Author: Keir Mierle <mierle@gmail.com>
|
||||
Date: Sat Aug 23 00:38:01 2014 -0700
|
||||
@@ -705,3 +666,37 @@ Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Feb 18 19:38:22 2014 +0600
|
||||
|
||||
Remove .orig file which was added by accident
|
||||
|
||||
commit 62597e3cf0f266a2fefec415c89759e502793e06
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Jan 2 16:02:08 2014 +0600
|
||||
|
||||
Upgrade glog to latest svn r139
|
||||
|
||||
The intention of this upgrade is to get rid of custom patches
|
||||
we've been having to support compilation on different platforms
|
||||
and compilers.
|
||||
|
||||
commit 2452d5d42b390c7ab853e6fe60e58bdd7a01a004
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Tue Feb 18 18:46:08 2014 +0600
|
||||
|
||||
Tweak Ceres CMake to detect uninstall target properly on Windows
|
||||
|
||||
commit 98a281d58ce2301f3dd239a97a448e53f48d0258
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Fri Feb 14 00:36:44 2014 +0600
|
||||
|
||||
Fix order of third party libs compilation and options used by them
|
||||
|
||||
WITH_FAST_DETECTOR was defined too late and third_party folder
|
||||
didn't see this option.
|
||||
|
||||
commit 4962bccd643ec0f2aed3035170d5f20e8f6efc85
|
||||
Author: Sergey Sharybin <sergey.vfx@gmail.com>
|
||||
Date: Thu Feb 13 23:55:03 2014 +0600
|
||||
|
||||
Disable Ceres unit tests and examples by default
|
||||
|
||||
Actually we're to switch to external Ceres rather than
|
||||
bundled one, would make life much easier actually.
|
||||
|
35
extern/libmv/SConscript
vendored
35
extern/libmv/SConscript
vendored
@@ -12,22 +12,6 @@ Import('env')
|
||||
defs = []
|
||||
incs = '.'
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/gflags/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
if not env['WITH_SHARED_PTR_SUPPORT']:
|
||||
print("-- Unable to find shared_ptr which is required for compilation.")
|
||||
@@ -38,6 +22,10 @@ if env['WITH_BF_LIBMV']:
|
||||
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
|
||||
defs.append('CERES_TR1_SHARED_PTR')
|
||||
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
src = env.Glob('intern/*.cc')
|
||||
src.remove('intern' + os.sep + 'stub.cc')
|
||||
src += env.Glob('libmv/autotrack/*.cc')
|
||||
@@ -47,6 +35,19 @@ if env['WITH_BF_LIBMV']:
|
||||
src += env.Glob('libmv/numeric/*.cc')
|
||||
src += env.Glob('libmv/simple_pipeline/*.cc')
|
||||
src += env.Glob('libmv/tracking/*.cc')
|
||||
src += env.Glob('third_party/gflags/*.cc')
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
@@ -56,12 +57,10 @@ env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defi
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
glog_src = []
|
||||
glog_src += env.Glob("third_party/gflags/*.cc")
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
glog_src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
glog_src.remove('third_party/gflags/windows_port.cc')
|
||||
glog_src += env.Glob("third_party/glog/src/*.cc")
|
||||
|
||||
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
109
extern/libmv/bundle.sh
vendored
109
extern/libmv/bundle.sh
vendored
@@ -75,7 +75,7 @@ for x in $src_dir $src_third_dir; do
|
||||
fi
|
||||
fi
|
||||
|
||||
if test `echo $x | grep -c "windows\|gflags" ` -eq 0; then
|
||||
if test `echo $x | grep -c windows ` -eq 0; then
|
||||
if [ -z "$src" ]; then
|
||||
src=$t
|
||||
else
|
||||
@@ -130,42 +130,13 @@ set(SRC
|
||||
libmv-capi.h
|
||||
)
|
||||
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/gflags/gflags
|
||||
third_party/glog/src
|
||||
third_party/ceres/include
|
||||
third_party/ceres/config
|
||||
../../intern/guardedalloc
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
\${EIGEN3_INCLUDE_DIRS}
|
||||
\${PNG_INCLUDE_DIRS}
|
||||
\${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
add_definitions(
|
||||
-DWITH_LIBMV_GUARDED_ALLOC
|
||||
-DGOOGLE_GLOG_DLL_DECL=
|
||||
-DLIBMV_NO_FAST_DETECTOR=
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WITH_LIBMV)
|
||||
TEST_SHARED_PTR_SUPPORT()
|
||||
if(SHARED_PTR_FOUND)
|
||||
if(SHARED_PTR_TR1_MEMORY_HEADER)
|
||||
@@ -178,6 +149,20 @@ if(WITH_LIBMV)
|
||||
message(FATAL_ERROR "Unable to find shared_ptr.")
|
||||
endif()
|
||||
|
||||
list(APPEND INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
third_party/ceres/include
|
||||
third_party/ceres/config
|
||||
../../intern/guardedalloc
|
||||
)
|
||||
|
||||
list(APPEND INC_SYS
|
||||
../Eigen3
|
||||
\${PNG_INCLUDE_DIRS}
|
||||
\${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
list(APPEND SRC
|
||||
intern/autotrack.cc
|
||||
intern/camera_intrinsics.cc
|
||||
@@ -209,6 +194,17 @@ ${headers}
|
||||
${third_headers}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND INC
|
||||
third_party/glog/src/windows
|
||||
)
|
||||
|
||||
if(NOT MINGW)
|
||||
list(APPEND INC
|
||||
third_party/msinttypes
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_GTESTS)
|
||||
blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}")
|
||||
@@ -228,7 +224,7 @@ if(WITH_LIBMV)
|
||||
endif()
|
||||
|
||||
# make GLog a separate target, so it can be used for gtest as well.
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
|
||||
if(WITH_LIBMV OR WITH_GTESTS OR WITH_CYCLES_LOGGING)
|
||||
# We compile GLog together with GFlag so we don't worry about
|
||||
# adding extra lib to linker.
|
||||
set(GLOG_SRC
|
||||
@@ -262,9 +258,6 @@ ${third_gflags_headers}
|
||||
third_party/glog/src/windows/glog/log_severity.h
|
||||
third_party/glog/src/windows/port.h
|
||||
third_party/glog/src/windows/config.h
|
||||
|
||||
third_party/gflags/windows_port.cc
|
||||
third_party/gflags/windows_port.h
|
||||
)
|
||||
else()
|
||||
list(APPEND GLOG_SRC
|
||||
@@ -274,11 +267,21 @@ ${third_glog_headers}
|
||||
)
|
||||
endif()
|
||||
|
||||
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${INC}" "\${INC_SYS}")
|
||||
set(GLOG_INC
|
||||
third_party/gflags
|
||||
third_party/glog/src
|
||||
)
|
||||
|
||||
set(GLOG_INC_SYS
|
||||
)
|
||||
|
||||
blender_add_lib(extern_glog "\${GLOG_SRC}" "\${GLOG_INC}" "\${GLOG_INC_SYS}")
|
||||
endif()
|
||||
EOF
|
||||
|
||||
cat > SConscript << EOF
|
||||
#!/usr/bin/python
|
||||
|
||||
# NOTE: This file is automatically generated by bundle.sh script
|
||||
# If you're doing changes in this file, please update template
|
||||
# in that script too
|
||||
@@ -291,22 +294,6 @@ Import('env')
|
||||
defs = []
|
||||
incs = '.'
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/gflags/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
|
||||
if env['WITH_BF_LIBMV']:
|
||||
if not env['WITH_SHARED_PTR_SUPPORT']:
|
||||
print("-- Unable to find shared_ptr which is required for compilation.")
|
||||
@@ -317,9 +304,25 @@ if env['WITH_BF_LIBMV']:
|
||||
if env['SHARED_PTR_NAMESPACE'] == 'std::tr1':
|
||||
defs.append('CERES_TR1_SHARED_PTR')
|
||||
|
||||
defs.append('GOOGLE_GLOG_DLL_DECL=')
|
||||
defs.append('WITH_LIBMV_GUARDED_ALLOC')
|
||||
defs.append('LIBMV_NO_FAST_DETECTOR')
|
||||
|
||||
src = env.Glob('intern/*.cc')
|
||||
src.remove('intern' + os.sep + 'stub.cc')
|
||||
$src
|
||||
|
||||
incs += ' ../Eigen3 third_party/gflags third_party/glog/src third_party/ceres/include third_party/ceres/config ../../intern/guardedalloc'
|
||||
incs += ' ' + env['BF_PNG_INC']
|
||||
incs += ' ' + env['BF_ZLIB_INC']
|
||||
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
incs += ' ./third_party/glog/src/windows ./third_party/glog/src/windows/glog'
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
|
||||
incs += ' ./third_party/msinttypes'
|
||||
${win_src}
|
||||
else:
|
||||
incs += ' ./third_party/glog/src'
|
||||
else:
|
||||
src = env.Glob("intern/stub.cc")
|
||||
|
||||
@@ -329,12 +332,10 @@ env.BlenderLib(libname = 'extern_libmv', sources=src, includes=Split(incs), defi
|
||||
|
||||
if env['WITH_BF_LIBMV'] or (env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']):
|
||||
glog_src = []
|
||||
glog_src += env.Glob("third_party/gflags/*.cc")
|
||||
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
|
||||
glog_src += ['./third_party/glog/src/logging.cc', './third_party/glog/src/raw_logging.cc', './third_party/glog/src/utilities.cc', './third_party/glog/src/vlog_is_on.cc']
|
||||
glog_src += ['./third_party/glog/src/windows/port.cc']
|
||||
else:
|
||||
glog_src.remove('third_party/gflags/windows_port.cc')
|
||||
glog_src += env.Glob("third_party/glog/src/*.cc")
|
||||
|
||||
env.BlenderLib(libname = 'extern_glog', sources=glog_src, includes=Split(incs), defines=defs, libtype=['extern', 'player'], priority=[20,137])
|
||||
|
10
extern/libmv/files.txt
vendored
10
extern/libmv/files.txt
vendored
@@ -133,10 +133,10 @@ libmv/tracking/track_region.cc
|
||||
libmv/tracking/track_region.h
|
||||
libmv/tracking/trklt_region_tracker.cc
|
||||
libmv/tracking/trklt_region_tracker.h
|
||||
third_party/gflags/AUTHORS.txt
|
||||
third_party/gflags/ChangeLog.txt
|
||||
third_party/gflags/AUTHORS
|
||||
third_party/gflags/ChangeLog
|
||||
third_party/gflags/config.h
|
||||
third_party/gflags/COPYING.txt
|
||||
third_party/gflags/COPYING
|
||||
third_party/gflags/gflags.cc
|
||||
third_party/gflags/gflags_completions.cc
|
||||
third_party/gflags/gflags/gflags_completions.h
|
||||
@@ -144,11 +144,9 @@ third_party/gflags/gflags/gflags_declare.h
|
||||
third_party/gflags/gflags/gflags.h
|
||||
third_party/gflags/gflags_reporting.cc
|
||||
third_party/gflags/mutex.h
|
||||
third_party/gflags/NEWS.txt
|
||||
third_party/gflags/NEWS
|
||||
third_party/gflags/README.libmv
|
||||
third_party/gflags/util.h
|
||||
third_party/gflags/windows_port.cc
|
||||
third_party/gflags/windows_port.h
|
||||
third_party/glog/AUTHORS
|
||||
third_party/glog/ChangeLog
|
||||
third_party/glog/COPYING
|
||||
|
18
extern/libmv/intern/logging.cc
vendored
18
extern/libmv/intern/logging.cc
vendored
@@ -35,21 +35,21 @@ void libmv_initLogging(const char* argv0) {
|
||||
google::GLOG_FATAL);
|
||||
|
||||
google::InitGoogleLogging(argv0);
|
||||
gflags::SetCommandLineOption("logtostderr", "1");
|
||||
gflags::SetCommandLineOption("v", "0");
|
||||
gflags::SetCommandLineOption("stderrthreshold", severity_fatal);
|
||||
gflags::SetCommandLineOption("minloglevel", severity_fatal);
|
||||
google::SetCommandLineOption("logtostderr", "1");
|
||||
google::SetCommandLineOption("v", "0");
|
||||
google::SetCommandLineOption("stderrthreshold", severity_fatal);
|
||||
google::SetCommandLineOption("minloglevel", severity_fatal);
|
||||
}
|
||||
|
||||
void libmv_startDebugLogging(void) {
|
||||
gflags::SetCommandLineOption("logtostderr", "1");
|
||||
gflags::SetCommandLineOption("v", "2");
|
||||
gflags::SetCommandLineOption("stderrthreshold", "1");
|
||||
gflags::SetCommandLineOption("minloglevel", "0");
|
||||
google::SetCommandLineOption("logtostderr", "1");
|
||||
google::SetCommandLineOption("v", "2");
|
||||
google::SetCommandLineOption("stderrthreshold", "1");
|
||||
google::SetCommandLineOption("minloglevel", "0");
|
||||
}
|
||||
|
||||
void libmv_setLoggingVerbosity(int verbosity) {
|
||||
char val[10];
|
||||
snprintf(val, sizeof(val), "%d", verbosity);
|
||||
gflags::SetCommandLineOption("v", val);
|
||||
google::SetCommandLineOption("v", val);
|
||||
}
|
||||
|
1
extern/libmv/libmv/autotrack/autotrack.cc
vendored
1
extern/libmv/libmv/autotrack/autotrack.cc
vendored
@@ -154,7 +154,6 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker,
|
||||
frame_accessor_,
|
||||
&tracked_image);
|
||||
if (!tracked_key) {
|
||||
frame_accessor_->ReleaseImage(reference_key);
|
||||
LG << "Couldn't get frame for tracked marker: " << tracked_marker;
|
||||
return false;
|
||||
}
|
||||
|
25
extern/libmv/libmv/multiview/homography.cc
vendored
25
extern/libmv/libmv/multiview/homography.cc
vendored
@@ -179,12 +179,8 @@ void GetNormalizedPoints(const Mat &original_points,
|
||||
class HomographySymmetricGeometricCostFunctor {
|
||||
public:
|
||||
HomographySymmetricGeometricCostFunctor(const Vec2 &x,
|
||||
const Vec2 &y) {
|
||||
xx_ = x(0);
|
||||
xy_ = x(1);
|
||||
yx_ = y(0);
|
||||
yy_ = y(1);
|
||||
}
|
||||
const Vec2 &y)
|
||||
: x_(x), y_(y) { }
|
||||
|
||||
template<typename T>
|
||||
bool operator()(const T *homography_parameters, T *residuals) const {
|
||||
@@ -193,8 +189,8 @@ class HomographySymmetricGeometricCostFunctor {
|
||||
|
||||
Mat3 H(homography_parameters);
|
||||
|
||||
Vec3 x(T(xx_), T(xy_), T(1.0));
|
||||
Vec3 y(T(yx_), T(yy_), T(1.0));
|
||||
Vec3 x(T(x_(0)), T(x_(1)), T(1.0));
|
||||
Vec3 y(T(y_(0)), T(y_(1)), T(1.0));
|
||||
|
||||
Vec3 H_x = H * x;
|
||||
Vec3 Hinv_y = H.inverse() * y;
|
||||
@@ -203,19 +199,18 @@ class HomographySymmetricGeometricCostFunctor {
|
||||
Hinv_y /= Hinv_y(2);
|
||||
|
||||
// This is a forward error.
|
||||
residuals[0] = H_x(0) - T(yx_);
|
||||
residuals[1] = H_x(1) - T(yy_);
|
||||
residuals[0] = H_x(0) - T(y_(0));
|
||||
residuals[1] = H_x(1) - T(y_(1));
|
||||
|
||||
// This is a backward error.
|
||||
residuals[2] = Hinv_y(0) - T(xx_);
|
||||
residuals[3] = Hinv_y(1) - T(xy_);
|
||||
residuals[2] = Hinv_y(0) - T(x_(0));
|
||||
residuals[3] = Hinv_y(1) - T(x_(1));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO(sergey): Think of better naming.
|
||||
double xx_, xy_;
|
||||
double yx_, yy_;
|
||||
const Vec2 x_;
|
||||
const Vec2 y_;
|
||||
};
|
||||
|
||||
// Termination checking callback used for homography estimation.
|
||||
|
@@ -36,7 +36,7 @@ set(INC
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${EIGEN3_INCLUDE_DIRS}
|
||||
../../../Eigen3
|
||||
)
|
||||
|
||||
set(SRC
|
||||
|
4
extern/libmv/third_party/ceres/bundle.sh
vendored
4
extern/libmv/third_party/ceres/bundle.sh
vendored
@@ -129,7 +129,7 @@ set(INC
|
||||
)
|
||||
|
||||
set(INC_SYS
|
||||
${EIGEN3_INCLUDE_DIRS}
|
||||
../../../Eigen3
|
||||
)
|
||||
|
||||
set(SRC
|
||||
@@ -201,7 +201,7 @@ blender_add_lib(extern_ceres "\${SRC}" "\${INC}" "\${INC_SYS}")
|
||||
EOF
|
||||
|
||||
cat > SConscript << EOF
|
||||
#!/usr/bin/env python
|
||||
#!/usr/bin/python
|
||||
|
||||
# NOTE: This file is automatically generated by bundle.sh script
|
||||
# If you're doing changes in this file, please update template
|
||||
|
195
extern/libmv/third_party/gflags/ChangeLog
vendored
Normal file
195
extern/libmv/third_party/gflags/ChangeLog
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
Wed Jan 25 15:09:14 2012 Google Inc. <google-gflags@googlegroups.com>
|
||||
|
||||
* gflags: version 2.0
|
||||
* Changed the 'official' gflags email in setup.py/etc
|
||||
* Renamed google-gflags.sln to gflags.sln
|
||||
* Changed copyright text to reflect Google's relinquished ownership
|
||||
|
||||
Tue Dec 20 19:48:57 2011 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.7
|
||||
* Add CommandLineFlagInfo::flag_ptr pointing to current storage (musji)
|
||||
* PORTING: flush after writing to stderr, needed on cygwin
|
||||
* PORTING: Clean up the GFLAGS_DLL_DECL stuff better
|
||||
* Fix a bug in StringPrintf() that affected large strings (csilvers)
|
||||
* Die at configure-time when g++ isn't installed
|
||||
|
||||
Fri Jul 29 19:05:21 2011 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.6
|
||||
* BUGFIX: Fix a bug where we were leaving out a required $(top_srcdir)
|
||||
* Fix definition of clstring (jyrki)
|
||||
* Split up flag declares into its own file (jyrki)
|
||||
* Add --version support (csilvers)
|
||||
* Update the README for gflags with static libs
|
||||
* Update acx_pthread.m4 for nostdlib
|
||||
* Change ReparseCommandLineFlags to return void (csilvers)
|
||||
* Some doc typofixes and example augmentation (various)
|
||||
|
||||
Mon Jan 24 16:11:35 2011 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.5
|
||||
* Better reporting of current vs default value (handler)
|
||||
* Add API for cleaning up of memory at program-exit (jmarantz)
|
||||
* Fix macros to work inside namespaces (csilvers)
|
||||
* Use our own string typedef in case string is redefined (csilvers)
|
||||
* Updated to autoconf 2.65
|
||||
|
||||
Wed Oct 13 17:40:12 2010 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.4
|
||||
* Add a check to prevent passing 0 to DEFINE_string (jorg)
|
||||
* Reduce compile (.o) size (jyrki)
|
||||
* Some small changes to quiet debug compiles (alexk)
|
||||
* PORTING: better support static linking on windows (csilvers)
|
||||
* DOCUMENTATION: change default values, use validators, etc.
|
||||
* Update the NEWS file to be non-empty
|
||||
* Add pkg-config (.pc) files for libgflags and libgflags_nothreads
|
||||
|
||||
Mon Jan 4 18:09:30 2010 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.3
|
||||
* PORTABILITY: can now build and run tests under MSVC (csilvers)
|
||||
* Remove the python gflags code, which is now its own package (tansell)
|
||||
* Clarify that "last flag wins" in the docs (csilvers)
|
||||
* Comment danger of using GetAllFlags in validators (wojtekm)
|
||||
* PORTABILITY: Some fixes necessary for c++0x (mboerger)
|
||||
* Makefile fix: $(srcdir) -> $(top_srcdir) in one place (csilvres)
|
||||
* INSTALL: autotools to autoconf v2.64 + automake v1.11 (csilvers)
|
||||
|
||||
Thu Sep 10 12:53:04 2009 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.2
|
||||
* PORTABILITY: can now build and run tests under mingw (csilvers)
|
||||
* Using a string arg for a bool flag is a compile-time error (rbayardo)
|
||||
* Add --helpxml to gflags.py (salcianu)
|
||||
* Protect against a hypothetical global d'tor mutex problem (csilvers)
|
||||
* BUGFIX: can now define a flag after 'using namespace google' (hamaji)
|
||||
|
||||
Tue Apr 14 12:35:25 2009 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.1
|
||||
* Add both foo and nofoo for boolean flags, with --undefok (andychu)
|
||||
* Better document how validators work (wojtekm)
|
||||
* Improve binary-detection for bash-completion (mtamsky)
|
||||
* Python: Add a concept of "key flags", used with --help (salcianu)
|
||||
* Python: Robustify flag_values (salcianu)
|
||||
* Python: Add a new DEFINE_bool alias (keir, andrewliu)
|
||||
* Python: Do module introspection based on module name (dsturtevant)
|
||||
* Fix autoconf a bit better, especially on windows and solaris (ajenjo)
|
||||
* BUG FIX: gflags_nothreads was linking against the wrong lib (ajenjo)
|
||||
* BUG FIX: threads-detection failed on FreeBSD; replace it (ajenjo)
|
||||
* PORTABILITY: Quiet an internal compiler error with SUSE 10 (csilvers)
|
||||
* PORTABILITY: Update deb.sh for more recenty debuilds (csilvers)
|
||||
* PORTABILITY: #include more headers to satify new gcc's (csilvers)
|
||||
* INSTALL: Updated to autoconf 2.61 and libtool 1.5.26 (csilvers)
|
||||
|
||||
Fri Oct 3 15:16:46 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.0
|
||||
* Add a missing newline to an error string (bcmills)
|
||||
* (otherwise exactly the same as gflags 1.0rc2)
|
||||
|
||||
Thu Sep 18 12:58:05 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 1.0rc2
|
||||
* Report current flag values in --helpxml (hdn)
|
||||
* Fix compilation troubles with gcc 4.3.3 (simonb)
|
||||
* BUG FIX: I was missing a std:: in DECLARE_string (csilvers)
|
||||
* BUG FIX: Clarify in docs how to specify --bool flags (csilvers)
|
||||
* BUG FIX: Fix --helpshort for source files not in a subdir (csilvers)
|
||||
* BUG FIX: Fix python unittest for 64-bit builds (bcmills)
|
||||
|
||||
Tue Aug 19 16:15:48 2008
|
||||
|
||||
* google-gflags: version 1.0rc1
|
||||
* Move #include files from google/ to gflags/ (csilvers)
|
||||
* Small optimizations to reduce binary (library) size (jyrki)
|
||||
* BUGFIX: forgot a std:: in one of the .h files (csilvers)
|
||||
* Speed up locking by making sure calls are inlined (ajenjo)
|
||||
* 64-BIT COMPATIBILITY: Use %PRId64 instead of %lld (csilvers)
|
||||
* PORTABILITY: fix Makefile to work with Cygwin (ajenjo)
|
||||
* PORTABILITY: fix code to compile under Visual Studio (ajenjo)
|
||||
* PORTABILITY: fix code to compile under Solaris 10 with CC (csilvers)
|
||||
|
||||
Mon Jul 21 23:01:38 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.9
|
||||
* Add the ability to validate a command-line flag (csilvers)
|
||||
* Add completion support for commandline flags in bash (daven)
|
||||
* Add -W compile flags to Makefile, when using gcc (csilvers)
|
||||
* Allow helpstring to be NULL (cristianoc)
|
||||
* Improved documentation of classes in the .cc file (csilvers)
|
||||
* Fix python bug with AppendFlagValues + shortnames (jjtswan)
|
||||
* Use bool instead of int for boolean flags in gflags.py (bcmills)
|
||||
* Simplify the way we declare flags, now more foolproof (csilvers)
|
||||
* Better error messages when bool flags collide (colohan)
|
||||
* Only evaluate DEFINE_foo macro args once (csilvers)
|
||||
|
||||
Wed Mar 26 15:20:18 2008 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.8
|
||||
* Export DescribeOneFlag() in the API
|
||||
* Add support for automatic line wrapping at 80 cols for gflags.py
|
||||
* Bugfix: do not treat an isolated "-" the same as an isolated "--"
|
||||
* Update rpm spec to point to Google Code rather than sourceforge (!)
|
||||
* Improve documentation (including documenting thread-safety)
|
||||
* Improve #include hygiene
|
||||
* Improve testing
|
||||
|
||||
Thu Oct 18 11:33:20 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.7
|
||||
* Deal even more correctly with libpthread not linked in (csilvers)
|
||||
* Add STRIP_LOG, an improved DO_NOT_SHOW_COMMANDLINE_HELP (sioffe)
|
||||
* Be more accurate printing default flag values in --help (dsturtevant)
|
||||
* Reduce .o file size a bit by using shorter namespace names (jeff)
|
||||
* Use relative install path, so 'setup.py --home' works (csilvers)
|
||||
* Notice when a boolean flag has a non-boolean default (bnmouli)
|
||||
* Broaden --helpshort to match foo-main.cc and foo_main.cc (hendrie)
|
||||
* Fix "no modules match" message for --helpshort, etc (hendrie)
|
||||
|
||||
Wed Aug 15 07:35:51 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.6
|
||||
* Deal correctly with case that libpthread is not linked in (csilvers)
|
||||
* Update Makefile/tests so we pass "make distcheck" (csilvers)
|
||||
* Document and test that last assignment to a flag wins (wan)
|
||||
|
||||
Tue Jun 12 15:23:42 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.5
|
||||
* Include all m4 macros in the distribution (csilvers)
|
||||
* Python: Fix broken data_files field in setup.py (sidlon)
|
||||
* Python: better string serliaizing and unparsing (abo, csimmons)
|
||||
* Fix checks for NaN and inf to work with Mac OS X (csilvers)
|
||||
|
||||
Thu Apr 19 15:15:07 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.4
|
||||
* Remove is_default from GetCommandLineFlagInfo (csilvers)
|
||||
* Portability fixes: includes, strtoll, gcc4.3 errors (csilvers)
|
||||
* A few doc typo cleanups (csilvers)
|
||||
|
||||
Wed Mar 28 12:15:56 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.3
|
||||
* python portability fix: use popen instead of subprocess (csilvers)
|
||||
* Add is_default to CommandLineFlagInfo (pchien)
|
||||
* Make docs a bit prettier (csilvers)
|
||||
* Actually include the python files in the distribution! :-/ (csilvers)
|
||||
|
||||
Mon Jan 22 15:33:06 2007 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: version 0.2
|
||||
* added support for python commandlineflags, as well as c++
|
||||
* gflags2man, a script to turn flags into a man page (dchristian)
|
||||
|
||||
Wed Dec 13 12:37:19 2006 Google Inc. <opensource@google.com>
|
||||
|
||||
* google-gflags: initial release:
|
||||
The gflags package contains a library that implements commandline
|
||||
flags processing. As such it's a replacement for getopt(). It
|
||||
has increased flexibility, including built-in support for C++
|
||||
types like string, and the ability to define flags in the source
|
||||
file in which they're used.
|
208
extern/libmv/third_party/gflags/ChangeLog.txt
vendored
208
extern/libmv/third_party/gflags/ChangeLog.txt
vendored
@@ -1,208 +0,0 @@
|
||||
* Sun Mar 20 2014 - Andreas Schuh <google-gflags@googlegroups.com>
|
||||
|
||||
- gflags: version 2.1.1
|
||||
- Fixed issue 77: GFLAGS_IS_A_DLL expands to empty string in gflags_declare.h
|
||||
- Fixed issue 79: GFLAGS_NAMESPACE not expanded to actual namespace in gflags_declare.h
|
||||
- Fixed issue 80: Allow include path to differ from GFLAGS_NAMESPACE
|
||||
|
||||
* Thu Mar 20 2014 - Andreas Schuh <google-gflags@googlegroups.com>
|
||||
|
||||
- gflags: version 2.1.0
|
||||
- Build system configuration using CMake instead of autotools
|
||||
- CPack packaging support for Debian/Ubuntu, Red Hat, and Mac OS X
|
||||
- Fixed issue 54: Fix "invalid suffix on literal" (C++11)
|
||||
- Fixed issue 57: Use _strdup instead of strdup on Windows
|
||||
- Fixed issue 62: Change all preprocessor include guards to start with GFLAGS_
|
||||
- Fixed issue 64: Add DEFINE_validator macro
|
||||
- Fixed issue 73: Warnings in Visual Studio 2010 and unable to compile unit test
|
||||
|
||||
* Wed Jan 25 2012 - Google Inc. <google-gflags@googlegroups.com>
|
||||
|
||||
- gflags: version 2.0
|
||||
- Changed the 'official' gflags email in setup.py/etc
|
||||
- Renamed google-gflags.sln to gflags.sln
|
||||
- Changed copyright text to reflect Google's relinquished ownership
|
||||
|
||||
* Tue Dec 20 2011 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.7
|
||||
- Add CommandLineFlagInfo::flag_ptr pointing to current storage (musji)
|
||||
- PORTING: flush after writing to stderr, needed on cygwin
|
||||
- PORTING: Clean up the GFLAGS_DLL_DECL stuff better
|
||||
- Fix a bug in StringPrintf() that affected large strings (csilvers)
|
||||
- Die at configure-time when g++ isn't installed
|
||||
|
||||
* Fri Jul 29 2011 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.6
|
||||
- BUGFIX: Fix a bug where we were leaving out a required $(top_srcdir)
|
||||
- Fix definition of clstring (jyrki)
|
||||
- Split up flag declares into its own file (jyrki)
|
||||
- Add --version support (csilvers)
|
||||
- Update the README for gflags with static libs
|
||||
- Update acx_pthread.m4 for nostdlib
|
||||
- Change ReparseCommandLineFlags to return void (csilvers)
|
||||
- Some doc typofixes and example augmentation (various)
|
||||
|
||||
* Mon Jan 24 2011 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.5
|
||||
- Better reporting of current vs default value (handler)
|
||||
- Add API for cleaning up of memory at program-exit (jmarantz)
|
||||
- Fix macros to work inside namespaces (csilvers)
|
||||
- Use our own string typedef in case string is redefined (csilvers)
|
||||
- Updated to autoconf 2.65
|
||||
|
||||
* Wed Oct 13 2010 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.4
|
||||
- Add a check to prevent passing 0 to DEFINE_string (jorg)
|
||||
- Reduce compile (.o) size (jyrki)
|
||||
- Some small changes to quiet debug compiles (alexk)
|
||||
- PORTING: better support static linking on windows (csilvers)
|
||||
- DOCUMENTATION: change default values, use validators, etc.
|
||||
- Update the NEWS file to be non-empty
|
||||
- Add pkg-config (.pc) files for libgflags and libgflags_nothreads
|
||||
|
||||
* Mon Jan 4 2010 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.3
|
||||
- PORTABILITY: can now build and run tests under MSVC (csilvers)
|
||||
- Remove the python gflags code, which is now its own package (tansell)
|
||||
- Clarify that "last flag wins" in the docs (csilvers)
|
||||
- Comment danger of using GetAllFlags in validators (wojtekm)
|
||||
- PORTABILITY: Some fixes necessary for c++0x (mboerger)
|
||||
- Makefile fix: $(srcdir) -> $(top_srcdir) in one place (csilvres)
|
||||
- INSTALL: autotools to autoconf v2.64 + automake v1.11 (csilvers)
|
||||
|
||||
* Thu Sep 10 2009 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.2
|
||||
- PORTABILITY: can now build and run tests under mingw (csilvers)
|
||||
- Using a string arg for a bool flag is a compile-time error (rbayardo)
|
||||
- Add --helpxml to gflags.py (salcianu)
|
||||
- Protect against a hypothetical global d'tor mutex problem (csilvers)
|
||||
- BUGFIX: can now define a flag after 'using namespace google' (hamaji)
|
||||
|
||||
* Tue Apr 14 2009 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.1
|
||||
- Add both foo and nofoo for boolean flags, with --undefok (andychu)
|
||||
- Better document how validators work (wojtekm)
|
||||
- Improve binary-detection for bash-completion (mtamsky)
|
||||
- Python: Add a concept of "key flags", used with --help (salcianu)
|
||||
- Python: Robustify flag_values (salcianu)
|
||||
- Python: Add a new DEFINE_bool alias (keir, andrewliu)
|
||||
- Python: Do module introspection based on module name (dsturtevant)
|
||||
- Fix autoconf a bit better, especially on windows and solaris (ajenjo)
|
||||
- BUG FIX: gflags_nothreads was linking against the wrong lib (ajenjo)
|
||||
- BUG FIX: threads-detection failed on FreeBSD; replace it (ajenjo)
|
||||
- PORTABILITY: Quiet an internal compiler error with SUSE 10 (csilvers)
|
||||
- PORTABILITY: Update deb.sh for more recenty debuilds (csilvers)
|
||||
- PORTABILITY: #include more headers to satify new gcc's (csilvers)
|
||||
- INSTALL: Updated to autoconf 2.61 and libtool 1.5.26 (csilvers)
|
||||
|
||||
* Fri Oct 3 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.0
|
||||
- Add a missing newline to an error string (bcmills)
|
||||
- (otherwise exactly the same as gflags 1.0rc2)
|
||||
|
||||
* Thu Sep 18 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.0rc2
|
||||
- Report current flag values in --helpxml (hdn)
|
||||
- Fix compilation troubles with gcc 4.3.3 (simonb)
|
||||
- BUG FIX: I was missing a std:: in DECLARE_string (csilvers)
|
||||
- BUG FIX: Clarify in docs how to specify --bool flags (csilvers)
|
||||
- BUG FIX: Fix --helpshort for source files not in a subdir (csilvers)
|
||||
- BUG FIX: Fix python unittest for 64-bit builds (bcmills)
|
||||
|
||||
* Tue Aug 19 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 1.0rc1
|
||||
- Move #include files from google/ to gflags/ (csilvers)
|
||||
- Small optimizations to reduce binary (library) size (jyrki)
|
||||
- BUGFIX: forgot a std:: in one of the .h files (csilvers)
|
||||
- Speed up locking by making sure calls are inlined (ajenjo)
|
||||
- 64-BIT COMPATIBILITY: Use %PRId64 instead of %lld (csilvers)
|
||||
- PORTABILITY: fix Makefile to work with Cygwin (ajenjo)
|
||||
- PORTABILITY: fix code to compile under Visual Studio (ajenjo)
|
||||
- PORTABILITY: fix code to compile under Solaris 10 with CC (csilvers)
|
||||
|
||||
* Mon Jul 21 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.9
|
||||
- Add the ability to validate a command-line flag (csilvers)
|
||||
- Add completion support for commandline flags in bash (daven)
|
||||
- Add -W compile flags to Makefile, when using gcc (csilvers)
|
||||
- Allow helpstring to be NULL (cristianoc)
|
||||
- Improved documentation of classes in the .cc file (csilvers)
|
||||
- Fix python bug with AppendFlagValues + shortnames (jjtswan)
|
||||
- Use bool instead of int for boolean flags in gflags.py (bcmills)
|
||||
- Simplify the way we declare flags, now more foolproof (csilvers)
|
||||
- Better error messages when bool flags collide (colohan)
|
||||
- Only evaluate DEFINE_foo macro args once (csilvers)
|
||||
|
||||
* Wed Mar 26 2008 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.8
|
||||
- Export DescribeOneFlag() in the API
|
||||
- Add support for automatic line wrapping at 80 cols for gflags.py
|
||||
- Bugfix: do not treat an isolated "-" the same as an isolated "--"
|
||||
- Update rpm spec to point to Google Code rather than sourceforge (!)
|
||||
- Improve documentation (including documenting thread-safety)
|
||||
- Improve #include hygiene
|
||||
- Improve testing
|
||||
|
||||
* Thu Oct 18 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.7
|
||||
- Deal even more correctly with libpthread not linked in (csilvers)
|
||||
- Add STRIP_LOG, an improved DO_NOT_SHOW_COMMANDLINE_HELP (sioffe)
|
||||
- Be more accurate printing default flag values in --help (dsturtevant)
|
||||
- Reduce .o file size a bit by using shorter namespace names (jeff)
|
||||
- Use relative install path, so 'setup.py --home' works (csilvers)
|
||||
- Notice when a boolean flag has a non-boolean default (bnmouli)
|
||||
- Broaden --helpshort to match foo-main.cc and foo_main.cc (hendrie)
|
||||
- Fix "no modules match" message for --helpshort, etc (hendrie)
|
||||
|
||||
* Wed Aug 15 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.6
|
||||
- Deal correctly with case that libpthread is not linked in (csilvers)
|
||||
- Update Makefile/tests so we pass "make distcheck" (csilvers)
|
||||
- Document and test that last assignment to a flag wins (wan)
|
||||
|
||||
* Tue Jun 12 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.5
|
||||
- Include all m4 macros in the distribution (csilvers)
|
||||
- Python: Fix broken data_files field in setup.py (sidlon)
|
||||
- Python: better string serliaizing and unparsing (abo, csimmons)
|
||||
- Fix checks for NaN and inf to work with Mac OS X (csilvers)
|
||||
|
||||
* Thu Apr 19 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.4
|
||||
- Remove is_default from GetCommandLineFlagInfo (csilvers)
|
||||
- Portability fixes: includes, strtoll, gcc4.3 errors (csilvers)
|
||||
- A few doc typo cleanups (csilvers)
|
||||
|
||||
* Wed Mar 28 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.3
|
||||
- python portability fix: use popen instead of subprocess (csilvers)
|
||||
- Add is_default to CommandLineFlagInfo (pchien)
|
||||
- Make docs a bit prettier (csilvers)
|
||||
- Actually include the python files in the distribution! :-/ (csilvers)
|
||||
|
||||
* Mon Jan 22 2007 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.2
|
||||
- added support for python commandlineflags, as well as c++
|
||||
- gflags2man, a script to turn flags into a man page (dchristian)
|
||||
|
||||
* Wed Dec 13 2006 - Google Inc. <opensource@google.com>
|
||||
|
||||
- google-gflags: version 0.1
|
@@ -1,86 +1,4 @@
|
||||
=== 30 March 2014 ===
|
||||
|
||||
I've just released gflags 2.1.1.
|
||||
|
||||
This release fixes a few bugs in the configuration of gflags_declare.h
|
||||
and adds a separate GFLAGS_INCLUDE_DIR CMake variable to the build configuration.
|
||||
Setting GFLAGS_NAMESPACE to "google" no longer changes also the include
|
||||
path of the public header files. This allows the use of the library with
|
||||
other Google projects such as glog which still use the deprecated "google"
|
||||
namespace for the gflags library, but include it as "gflags/gflags.h".
|
||||
|
||||
=== 20 March 2014 ===
|
||||
|
||||
I've just released gflags 2.1.
|
||||
|
||||
The major changes are the use of CMake for the build configuration instead
|
||||
of the autotools and packaging support through CPack. The default namespace
|
||||
of all C++ symbols is now "gflags" instead of "google". This can be
|
||||
configured via the GFLAGS_NAMESPACE variable.
|
||||
|
||||
This release compiles with all major compilers without warnings and passed
|
||||
the unit tests on Ubuntu 12.04, Windows 7 (Visual Studio 2008 and 2010,
|
||||
Cygwin, MinGW), and Mac OS X (Xcode 5.1).
|
||||
|
||||
The SVN repository on Google Code is now frozen and replaced by a Git
|
||||
repository such that it can be used as Git submodule by projects. The main
|
||||
hosting of this project remains at Google Code. Thanks to the distributed
|
||||
character of Git, I can push (and pull) changes from both GitHub and Google Code
|
||||
in order to keep the two public repositories in sync.
|
||||
When fixing an issue for a pull request through either of these hosting
|
||||
platforms, please reference the issue number as
|
||||
[https://code.google.com/p/support/wiki/IssueTracker#Integration_with_version_control described here].
|
||||
For the further development, I am following the
|
||||
[http://nvie.com/posts/a-successful-git-branching-model/ Git branching model]
|
||||
with feature branch names prefixed by "feature/" and bugfix branch names
|
||||
prefixed by "bugfix/", respectively.
|
||||
|
||||
Binary and source [https://github.com/schuhschuh/gflags/releases packages] are available on GitHub.
|
||||
|
||||
|
||||
=== 14 January 2013 ===
|
||||
|
||||
The migration of the build system to CMake is almost complete.
|
||||
What remains to be done is rewriting the tests in Python such they can be
|
||||
executed on non-Unix platforms and splitting them up into separate CTest tests.
|
||||
Though merging these changes into the master branch yet remains to be done,
|
||||
it is recommended to already start using the
|
||||
[https://github.com/schuhschuh/gflags/tree/cmake-migration cmake-migration] branch.
|
||||
|
||||
|
||||
=== 20 April 2013 ===
|
||||
|
||||
More than a year has past since I (Andreas) took over the maintenance for
|
||||
`gflags`. Only few minor changes have been made since then, much to my regret.
|
||||
To get more involved and stimulate participation in the further
|
||||
development of the library, I moved the project source code today to
|
||||
[https://github.com/schuhschuh/gflags GitHub].
|
||||
I believe that the strengths of [http://git-scm.com/ Git] will allow for better community collaboration
|
||||
as well as ease the integration of changes made by others. I encourage everyone
|
||||
who would like to contribute to send me pull requests.
|
||||
Git's lightweight feature branches will also provide the right tool for more
|
||||
radical changes which should only be merged back into the master branch
|
||||
after these are complete and implement the desired behavior.
|
||||
|
||||
The SVN repository remains accessible at Google Code and I will keep the
|
||||
master branch of the Git repository hosted at GitHub and the trunk of the
|
||||
Subversion repository synchronized. Initially, I was going to simply switch the
|
||||
Google Code project to Git, but in this case the SVN repository would be
|
||||
frozen and force everyone who would like the latest development changes to
|
||||
use Git as well. Therefore I decided to host the public Git repository at GitHub
|
||||
instead.
|
||||
|
||||
Please continue to report any issues with gflags on Google Code. The GitHub project will
|
||||
only be used to host the Git repository.
|
||||
|
||||
One major change of the project structure I have in mind for the next weeks
|
||||
is the migration from autotools to [http://www.cmake.org/ CMake].
|
||||
Check out the (unstable!)
|
||||
[https://github.com/schuhschuh/gflags/tree/cmake-migration cmake-migration]
|
||||
branch on GitHub for details.
|
||||
|
||||
|
||||
=== 25 January 2012 ===
|
||||
== 25 January 2012 ==
|
||||
|
||||
I've just released gflags 2.0.
|
||||
|
||||
@@ -210,7 +128,7 @@ If you've tried to install a .rpm or .deb and it doesn't work for you,
|
||||
let me know. I'm excited to finally have 64-bit package files, but
|
||||
there may still be some wrinkles in the new system to iron out.
|
||||
|
||||
=== 1 October 2008 ===
|
||||
===1 October 2008===
|
||||
|
||||
gflags 1.0rc2 was out for a few weeks without any issues, so gflags
|
||||
1.0 is now released. This is much like gflags 0.9. The major change
|
16
extern/libmv/third_party/gflags/README.libmv
vendored
16
extern/libmv/third_party/gflags/README.libmv
vendored
@@ -1,18 +1,16 @@
|
||||
Project: Google Flags
|
||||
URL: http://code.google.com/p/google-gflags/
|
||||
License: New BSD
|
||||
Upstream version: 2.1.1
|
||||
Upstream version: 2.0
|
||||
Local modifications:
|
||||
|
||||
- Flattened the tree and only included files needed for libmv.
|
||||
- Flattened the tree and only included files needed for libmv. This involved
|
||||
changing some of the includes to point to the current directory instead of a
|
||||
nested gflags directory.
|
||||
|
||||
- config.h was originally generated on linux machine with some
|
||||
further tweaks:
|
||||
- Added a poor-man's version of upstream's port.cc/h to make gflags compile on
|
||||
windows. This isn't sufficient but is a stopgap for now.
|
||||
|
||||
* OS_WINDOWS need to be conditinally defined from inside #ifdef WIN32
|
||||
* Same applies yo HAVE_SHLWAPI_H
|
||||
* Disabeld HAVE_FNMATCH_H
|
||||
|
||||
- Removed attribute(unused) from FlagSaver.
|
||||
- Added -fPIC flag, so shared libraries from Ceres could be linked against static glog
|
||||
|
||||
TODO(keir): Import and use gflags for Windows from upstream.
|
||||
|
160
extern/libmv/third_party/gflags/config.h
vendored
160
extern/libmv/third_party/gflags/config.h
vendored
@@ -1,117 +1,101 @@
|
||||
/* Generated from config.h.in during build configuration using CMake. */
|
||||
/* src/config.h. Generated from config.h.in by configure. */
|
||||
/* src/config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
// Note: This header file is only used internally. It is not part of public interface!
|
||||
/* Always the empty-string on non-windows systems. On windows, should be
|
||||
"__declspec(dllexport)". This way, when we compile the dll, we export our
|
||||
functions/classes. It's safe to define this here because config.h is only
|
||||
used internally, to compile the DLL, and every DLL source file #includes
|
||||
"config.h" before anything else. */
|
||||
#define GFLAGS_DLL_DECL /**/
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// System checks
|
||||
/* Namespace for Google classes */
|
||||
#define GOOGLE_NAMESPACE ::google
|
||||
|
||||
// Define if you build this library for a MS Windows OS.
|
||||
#ifdef WIN32
|
||||
# define OS_WINDOWS
|
||||
#endif
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
// Define if you have the <stdint.h> header file.
|
||||
#define HAVE_STDINT_H
|
||||
/* Define to 1 if you have the <fnmatch.h> header file. */
|
||||
/* #ubdef HAVE_FNMATCH_H 1 */
|
||||
|
||||
// Define if you have the <sys/types.h> header file.
|
||||
#define HAVE_SYS_TYPES_H
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
// Define if you have the <inttypes.h> header file.
|
||||
#define HAVE_INTTYPES_H
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
// Define if you have the <sys/stat.h> header file.
|
||||
#define HAVE_SYS_STAT_H
|
||||
/* define if the compiler implements namespaces */
|
||||
#define HAVE_NAMESPACES 1
|
||||
|
||||
// Define if you have the <unistd.h> header file.
|
||||
#define HAVE_UNISTD_H
|
||||
/* Define if you have POSIX threads libraries and header files. */
|
||||
#define HAVE_PTHREAD 1
|
||||
|
||||
// Define if you have the <fnmatch.h> header file.
|
||||
/* #undef HAVE_FNMATCH_H */
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
// Define if you have the <shlwapi.h> header file (Windows 2000/XP).
|
||||
#undef HAVE_SHLWAPI_H
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
// Define if you have the strtoll function.
|
||||
#define HAVE_STRTOLL
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
// Define if you have the strtoq function.
|
||||
/* #undef HAVE_STRTOQ */
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
// Define if you have the <pthread.h> header file.
|
||||
#define HAVE_PTHREAD
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
// Define if your pthread library defines the type pthread_rwlock_t
|
||||
#define HAVE_RWLOCK
|
||||
/* Define to 1 if you have the `strtoq' function. */
|
||||
#define HAVE_STRTOQ 1
|
||||
|
||||
// gcc requires this to get PRId64, etc.
|
||||
#if defined(HAVE_INTTYPES_H) && !defined(__STDC_FORMAT_MACROS)
|
||||
# define __STDC_FORMAT_MACROS 1
|
||||
#endif
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Package information
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
// Name of package.
|
||||
#define PACKAGE gflags
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
// Define to the full name of this package.
|
||||
#define PACKAGE_NAME gflags
|
||||
/* define if your compiler has __attribute__ */
|
||||
#define HAVE___ATTRIBUTE__ 1
|
||||
|
||||
// Define to the full name and version of this package.
|
||||
#define PACKAGE_STRING gflags 2.1.1
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#define LT_OBJDIR ".libs/"
|
||||
|
||||
// Define to the one symbol short name of this package.
|
||||
#define PACKAGE_TARNAME gflags-2.1.1
|
||||
/* Name of package */
|
||||
#define PACKAGE "gflags"
|
||||
|
||||
// Define to the version of this package.
|
||||
#define PACKAGE_VERSION 2.1.1
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "google-gflags@googlegroups.com"
|
||||
|
||||
// Version number of package.
|
||||
#define VERSION PACKAGE_VERSION
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "gflags"
|
||||
|
||||
// Define to the address where bug reports for this package should be sent.
|
||||
#define PACKAGE_BUGREPORT https://code.google.com/p/gflags/issues/
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "gflags 2.0"
|
||||
|
||||
// Namespace of gflags library symbols.
|
||||
#define GFLAGS_NAMESPACE gflags
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "gflags"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Path separator
|
||||
#ifndef PATH_SEPARATOR
|
||||
# ifdef OS_WINDOWS
|
||||
# define PATH_SEPARATOR '\\'
|
||||
# else
|
||||
# define PATH_SEPARATOR '/'
|
||||
# endif
|
||||
#endif
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "2.0"
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Windows
|
||||
/* Define to necessary symbol if this constant uses a non-standard name on
|
||||
your system. */
|
||||
/* #undef PTHREAD_CREATE_JOINABLE */
|
||||
|
||||
// Whether gflags library is a DLL.
|
||||
#ifndef GFLAGS_IS_A_DLL
|
||||
# define GFLAGS_IS_A_DLL 0
|
||||
#endif
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
// Always export symbols when compiling a shared library as this file is only
|
||||
// included by internal modules when building the gflags library itself.
|
||||
// The gflags_declare.h header file will set it to import these symbols otherwise.
|
||||
#ifndef GFLAGS_DLL_DECL
|
||||
# if GFLAGS_IS_A_DLL && defined(_MSC_VER)
|
||||
# define GFLAGS_DLL_DECL __declspec(dllexport)
|
||||
# else
|
||||
# define GFLAGS_DLL_DECL
|
||||
# endif
|
||||
#endif
|
||||
// Flags defined by the gflags library itself must be exported
|
||||
#ifndef GFLAGS_DLL_DEFINE_FLAG
|
||||
# define GFLAGS_DLL_DEFINE_FLAG GFLAGS_DLL_DECL
|
||||
#endif
|
||||
/* the namespace where STL code like vector<> is defined */
|
||||
#define STL_NAMESPACE std
|
||||
|
||||
#ifdef OS_WINDOWS
|
||||
// The unittests import the symbols of the shared gflags library
|
||||
# if GFLAGS_IS_A_DLL && defined(_MSC_VER)
|
||||
# define GFLAGS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport)
|
||||
# endif
|
||||
# include "windows_port.h"
|
||||
#endif
|
||||
/* Version number of package */
|
||||
#define VERSION "2.0"
|
||||
|
||||
/* Stops putting the code inside the Google namespace */
|
||||
#define _END_GOOGLE_NAMESPACE_ }
|
||||
|
||||
/* Puts following code inside the Google namespace */
|
||||
#define _START_GOOGLE_NAMESPACE_ namespace google {
|
||||
|
117
extern/libmv/third_party/gflags/gflags.cc
vendored
117
extern/libmv/third_party/gflags/gflags.cc
vendored
@@ -87,16 +87,18 @@
|
||||
// other hand, hooks into CommandLineFlagParser. Other API functions
|
||||
// are, similarly, mostly hooks into the functionality described above.
|
||||
|
||||
// This comes first to ensure we define __STDC_FORMAT_MACROS in time.
|
||||
#include "config.h"
|
||||
#include "gflags.h"
|
||||
#if defined(HAVE_INTTYPES_H) && !defined(__STDC_FORMAT_MACROS)
|
||||
# define __STDC_FORMAT_MACROS 1 // gcc requires this to get PRId64, etc.
|
||||
#endif
|
||||
|
||||
#include "gflags/gflags.h"
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#if defined(HAVE_FNMATCH_H)
|
||||
# include <fnmatch.h>
|
||||
#elif defined(HAVE_SHLWAPI_H)
|
||||
# include <shlwapi.h>
|
||||
#ifdef HAVE_FNMATCH_H
|
||||
# include <fnmatch.h>
|
||||
#endif
|
||||
#include <stdarg.h> // For va_list and related operations
|
||||
#include <stdio.h>
|
||||
@@ -107,23 +109,31 @@
|
||||
#include <string>
|
||||
#include <utility> // for pair<>
|
||||
#include <vector>
|
||||
|
||||
#include "mutex.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifndef PATH_SEPARATOR
|
||||
#define PATH_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
|
||||
// Special flags, type 1: the 'recursive' flags. They set another flag's val.
|
||||
DEFINE_string(flagfile, "", "load flags from file");
|
||||
DEFINE_string(fromenv, "", "set flags from the environment"
|
||||
" [use 'export FLAGS_flag1=value']");
|
||||
DEFINE_string(tryfromenv, "", "set flags from the environment if present");
|
||||
DEFINE_string(flagfile, "",
|
||||
"load flags from file");
|
||||
DEFINE_string(fromenv, "",
|
||||
"set flags from the environment"
|
||||
" [use 'export FLAGS_flag1=value']");
|
||||
DEFINE_string(tryfromenv, "",
|
||||
"set flags from the environment if present");
|
||||
|
||||
// Special flags, type 2: the 'parsing' flags. They modify how we parse.
|
||||
DEFINE_string(undefok, "", "comma-separated list of flag names that it is okay to specify "
|
||||
"on the command line even if the program does not define a flag "
|
||||
"with that name. IMPORTANT: flags in this list that have "
|
||||
"arguments MUST use the flag=value format");
|
||||
DEFINE_string(undefok, "",
|
||||
"comma-separated list of flag names that it is okay to specify "
|
||||
"on the command line even if the program does not define a flag "
|
||||
"with that name. IMPORTANT: flags in this list that have "
|
||||
"arguments MUST use the flag=value format");
|
||||
|
||||
namespace GFLAGS_NAMESPACE {
|
||||
_START_GOOGLE_NAMESPACE_
|
||||
|
||||
using std::map;
|
||||
using std::pair;
|
||||
@@ -196,7 +206,7 @@ class FlagValue {
|
||||
|
||||
private:
|
||||
friend class CommandLineFlag; // for many things, including Validate()
|
||||
friend class GFLAGS_NAMESPACE::FlagSaverImpl; // calls New()
|
||||
friend class GOOGLE_NAMESPACE::FlagSaverImpl; // calls New()
|
||||
friend class FlagRegistry; // checks value_buffer_ for flags_by_ptr_ map
|
||||
template <typename T> friend T GetFromEnv(const char*, const char*, T);
|
||||
friend bool TryParseLocked(const CommandLineFlag*, FlagValue*,
|
||||
@@ -338,13 +348,13 @@ string FlagValue::ToString() const {
|
||||
case FV_BOOL:
|
||||
return VALUE_AS(bool) ? "true" : "false";
|
||||
case FV_INT32:
|
||||
snprintf(intbuf, sizeof(intbuf), "%" PRId32, VALUE_AS(int32));
|
||||
snprintf(intbuf, sizeof(intbuf), "%"PRId32, VALUE_AS(int32));
|
||||
return intbuf;
|
||||
case FV_INT64:
|
||||
snprintf(intbuf, sizeof(intbuf), "%" PRId64, VALUE_AS(int64));
|
||||
snprintf(intbuf, sizeof(intbuf), "%"PRId64, VALUE_AS(int64));
|
||||
return intbuf;
|
||||
case FV_UINT64:
|
||||
snprintf(intbuf, sizeof(intbuf), "%" PRIu64, VALUE_AS(uint64));
|
||||
snprintf(intbuf, sizeof(intbuf), "%"PRIu64, VALUE_AS(uint64));
|
||||
return intbuf;
|
||||
case FV_DOUBLE:
|
||||
snprintf(intbuf, sizeof(intbuf), "%.17g", VALUE_AS(double));
|
||||
@@ -396,7 +406,8 @@ const char* FlagValue::TypeName() const {
|
||||
assert(false);
|
||||
return "";
|
||||
}
|
||||
// Directly indexing the strings in the 'types' string, each of them is 7 bytes long.
|
||||
// Directly indexing the strigns in the 'types' string, each of them
|
||||
// is 7 bytes long.
|
||||
return &types[type_ * 7];
|
||||
}
|
||||
|
||||
@@ -493,7 +504,7 @@ class CommandLineFlag {
|
||||
private:
|
||||
// for SetFlagLocked() and setting flags_by_ptr_
|
||||
friend class FlagRegistry;
|
||||
friend class GFLAGS_NAMESPACE::FlagSaverImpl; // for cloning the values
|
||||
friend class GOOGLE_NAMESPACE::FlagSaverImpl; // for cloning the values
|
||||
// set validate_fn
|
||||
friend bool AddFlagValidator(const void*, ValidateFnProto);
|
||||
|
||||
@@ -660,9 +671,9 @@ class FlagRegistry {
|
||||
static FlagRegistry* GlobalRegistry(); // returns a singleton registry
|
||||
|
||||
private:
|
||||
friend class GFLAGS_NAMESPACE::FlagSaverImpl; // reads all the flags in order to copy them
|
||||
friend class GOOGLE_NAMESPACE::FlagSaverImpl; // reads all the flags in order to copy them
|
||||
friend class CommandLineFlagParser; // for ValidateAllFlags
|
||||
friend void GFLAGS_NAMESPACE::GetAllFlags(vector<CommandLineFlagInfo>*);
|
||||
friend void GOOGLE_NAMESPACE::GetAllFlags(vector<CommandLineFlagInfo>*);
|
||||
|
||||
// The map from name to flag, for FindFlagLocked().
|
||||
typedef map<const char*, CommandLineFlag*, StringCmp> FlagMap;
|
||||
@@ -992,8 +1003,8 @@ static string ReadFileIntoString(const char* filename) {
|
||||
const int kBufSize = 8092;
|
||||
char buffer[kBufSize];
|
||||
string s;
|
||||
FILE* fp;
|
||||
if ((errno = SafeFOpen(&fp, filename, "r")) != 0) PFATAL(filename);
|
||||
FILE* fp = fopen(filename, "r");
|
||||
if (!fp) PFATAL(filename);
|
||||
size_t n;
|
||||
while ( (n=fread(buffer, 1, kBufSize, fp)) > 0 ) {
|
||||
if (ferror(fp)) PFATAL(filename);
|
||||
@@ -1137,8 +1148,8 @@ string CommandLineFlagParser::ProcessFromenvLocked(const string& flagval,
|
||||
}
|
||||
|
||||
const string envname = string("FLAGS_") + string(flagname);
|
||||
string envval;
|
||||
if (!SafeGetEnv(envname.c_str(), envval)) {
|
||||
const char* envval = getenv(envname.c_str());
|
||||
if (!envval) {
|
||||
if (errors_are_fatal) {
|
||||
error_flags_[flagname] = (string(kError) + envname +
|
||||
" not found in environment\n");
|
||||
@@ -1147,14 +1158,15 @@ string CommandLineFlagParser::ProcessFromenvLocked(const string& flagval,
|
||||
}
|
||||
|
||||
// Avoid infinite recursion.
|
||||
if (envval == "fromenv" || envval == "tryfromenv") {
|
||||
if ((strcmp(envval, "fromenv") == 0) ||
|
||||
(strcmp(envval, "tryfromenv") == 0)) {
|
||||
error_flags_[flagname] =
|
||||
StringPrintf("%sinfinite recursion on environment flag '%s'\n",
|
||||
kError, envval.c_str());
|
||||
kError, envval);
|
||||
continue;
|
||||
}
|
||||
|
||||
msg += ProcessSingleOptionLocked(flag, envval.c_str(), set_mode);
|
||||
msg += ProcessSingleOptionLocked(flag, envval, set_mode);
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
@@ -1306,12 +1318,13 @@ string CommandLineFlagParser::ProcessOptionsFromStringLocked(
|
||||
// We try matching both against the full argv0 and basename(argv0)
|
||||
if (glob == ProgramInvocationName() // small optimization
|
||||
|| glob == ProgramInvocationShortName()
|
||||
#if defined(HAVE_FNMATCH_H)
|
||||
|| fnmatch(glob.c_str(), ProgramInvocationName(), FNM_PATHNAME) == 0
|
||||
|| fnmatch(glob.c_str(), ProgramInvocationShortName(), FNM_PATHNAME) == 0
|
||||
#elif defined(HAVE_SHLWAPI_H)
|
||||
|| PathMatchSpec(glob.c_str(), ProgramInvocationName())
|
||||
|| PathMatchSpec(glob.c_str(), ProgramInvocationShortName())
|
||||
#ifdef HAVE_FNMATCH_H
|
||||
|| fnmatch(glob.c_str(),
|
||||
ProgramInvocationName(),
|
||||
FNM_PATHNAME) == 0
|
||||
|| fnmatch(glob.c_str(),
|
||||
ProgramInvocationShortName(),
|
||||
FNM_PATHNAME) == 0
|
||||
#endif
|
||||
) {
|
||||
flags_are_relevant = true;
|
||||
@@ -1333,15 +1346,14 @@ string CommandLineFlagParser::ProcessOptionsFromStringLocked(
|
||||
|
||||
template<typename T>
|
||||
T GetFromEnv(const char *varname, const char* type, T dflt) {
|
||||
std::string valstr;
|
||||
if (SafeGetEnv(varname, valstr)) {
|
||||
FlagValue ifv(new T, type, true);
|
||||
if (!ifv.ParseFrom(valstr.c_str())) {
|
||||
ReportError(DIE, "ERROR: error parsing env variable '%s' with value '%s'\n",
|
||||
varname, valstr.c_str());
|
||||
}
|
||||
return OTHER_VALUE_AS(ifv, T);
|
||||
} else return dflt;
|
||||
const char* const valstr = getenv(varname);
|
||||
if (!valstr)
|
||||
return dflt;
|
||||
FlagValue ifv(new T, type, true);
|
||||
if (!ifv.ParseFrom(valstr))
|
||||
ReportError(DIE, "ERROR: error parsing env variable '%s' with value '%s'\n",
|
||||
varname, valstr);
|
||||
return OTHER_VALUE_AS(ifv, T);
|
||||
}
|
||||
|
||||
bool AddFlagValidator(const void* flag_ptr, ValidateFnProto validate_fn_proto) {
|
||||
@@ -1753,8 +1765,8 @@ bool ReadFlagsFromString(const string& flagfilecontents,
|
||||
|
||||
// TODO(csilvers): nix prog_name in favor of ProgramInvocationShortName()
|
||||
bool AppendFlagsIntoFile(const string& filename, const char *prog_name) {
|
||||
FILE *fp;
|
||||
if (SafeFOpen(&fp, filename.c_str(), "a") != 0) {
|
||||
FILE *fp = fopen(filename.c_str(), "a");
|
||||
if (!fp) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1812,18 +1824,10 @@ uint64 Uint64FromEnv(const char *v, uint64 dflt) {
|
||||
double DoubleFromEnv(const char *v, double dflt) {
|
||||
return GetFromEnv(v, "double", dflt);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4996) // ignore getenv security warning
|
||||
#endif
|
||||
const char *StringFromEnv(const char *varname, const char *dflt) {
|
||||
const char* const val = getenv(varname);
|
||||
return val ? val : dflt;
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -1953,5 +1957,4 @@ void ShutDownCommandLineFlags() {
|
||||
FlagRegistry::DeleteGlobalRegistry();
|
||||
}
|
||||
|
||||
|
||||
} // namespace GFLAGS_NAMESPACE
|
||||
_END_GOOGLE_NAMESPACE_
|
||||
|
180
extern/libmv/third_party/gflags/gflags/gflags.h
vendored
180
extern/libmv/third_party/gflags/gflags/gflags.h
vendored
@@ -75,26 +75,21 @@
|
||||
// other thread is writing to the variable or calling non-const
|
||||
// methods of this class.
|
||||
|
||||
#ifndef GFLAGS_GFLAGS_H_
|
||||
#define GFLAGS_GFLAGS_H_
|
||||
#ifndef BASE_COMMANDLINEFLAGS_H_
|
||||
#define BASE_COMMANDLINEFLAGS_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "gflags_declare.h" // IWYU pragma: export
|
||||
namespace google {
|
||||
|
||||
#include "gflags_declare.h" // IWYU pragma: export
|
||||
|
||||
|
||||
// We always want to export variables defined in user code
|
||||
#ifndef GFLAGS_DLL_DEFINE_FLAG
|
||||
# if 0 && defined(_MSC_VER)
|
||||
# define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport)
|
||||
# else
|
||||
# define GFLAGS_DLL_DEFINE_FLAG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
namespace gflags {
|
||||
//
|
||||
// NOTE: all functions below MUST have an explicit 'extern' before
|
||||
// them. Our automated opensourcing tools use this as a signal to do
|
||||
// appropriate munging for windows, which needs to add GFLAGS_DLL_DECL.
|
||||
//
|
||||
#define GFLAGS_DLL_DECL /* rewritten to be non-empty in windows dir */
|
||||
#define GFLAGS_DLL_DEFINE_FLAG /* rewritten to be non-empty in windows dir */
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -126,17 +121,19 @@ namespace gflags {
|
||||
// Returns true if successfully registered, false if not (because the
|
||||
// first argument doesn't point to a command-line flag, or because a
|
||||
// validator is already registered for this flag).
|
||||
extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const bool* flag, bool (*validate_fn)(const char*, bool));
|
||||
extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const int32* flag, bool (*validate_fn)(const char*, int32));
|
||||
extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const int64* flag, bool (*validate_fn)(const char*, int64));
|
||||
extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const uint64* flag, bool (*validate_fn)(const char*, uint64));
|
||||
extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const double* flag, bool (*validate_fn)(const char*, double));
|
||||
extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const std::string* flag, bool (*validate_fn)(const char*, const std::string&));
|
||||
|
||||
// Convenience macro for the registration of a flag validator
|
||||
#define DEFINE_validator(name, validator) \
|
||||
static const bool name##_validator_registered = \
|
||||
gflags::RegisterFlagValidator(&FLAGS_##name, validator)
|
||||
extern bool RegisterFlagValidator(const bool* flag,
|
||||
bool (*validate_fn)(const char*, bool));
|
||||
extern bool RegisterFlagValidator(const int32* flag,
|
||||
bool (*validate_fn)(const char*, int32));
|
||||
extern bool RegisterFlagValidator(const int64* flag,
|
||||
bool (*validate_fn)(const char*, int64));
|
||||
extern bool RegisterFlagValidator(const uint64* flag,
|
||||
bool (*validate_fn)(const char*, uint64));
|
||||
extern bool RegisterFlagValidator(const double* flag,
|
||||
bool (*validate_fn)(const char*, double));
|
||||
extern bool RegisterFlagValidator(const std::string* flag,
|
||||
bool (*validate_fn)(const char*,
|
||||
const std::string&));
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -149,20 +146,19 @@ extern GFLAGS_DLL_DECL bool RegisterFlagValidator(const std::string* flag, bool
|
||||
// In addition to accessing flags, you can also access argv[0] (the program
|
||||
// name) and argv (the entire commandline), which we sock away a copy of.
|
||||
// These variables are static, so you should only set them once.
|
||||
//
|
||||
// No need to export this data only structure from DLL, avoiding VS warning 4251.
|
||||
struct CommandLineFlagInfo {
|
||||
|
||||
struct GFLAGS_DLL_DECL CommandLineFlagInfo {
|
||||
std::string name; // the name of the flag
|
||||
std::string type; // the type of the flag: int32, etc
|
||||
std::string description; // the "help text" associated with the flag
|
||||
std::string current_value; // the current value, as a string
|
||||
std::string default_value; // the default value, as a string
|
||||
std::string filename; // 'cleaned' version of filename holding the flag
|
||||
bool has_validator_fn; // true if RegisterFlagValidator called on this flag
|
||||
bool is_default; // true if the flag has the default value and
|
||||
// has not been set explicitly from the cmdline
|
||||
// or via SetCommandLineOption
|
||||
const void* flag_ptr; // pointer to the flag's current value (i.e. FLAGS_foo)
|
||||
bool has_validator_fn; // true if RegisterFlagValidator called on this flag
|
||||
bool is_default; // true if the flag has the default value and
|
||||
// has not been set explicitly from the cmdline
|
||||
// or via SetCommandLineOption
|
||||
const void* flag_ptr; // pointer to the flag's current value (i.e. FLAGS_foo)
|
||||
};
|
||||
|
||||
// Using this inside of a validator is a recipe for a deadlock.
|
||||
@@ -170,34 +166,34 @@ struct CommandLineFlagInfo {
|
||||
// call validators during ParseAllFlags.
|
||||
// Also make sure then to uncomment the corresponding unit test in
|
||||
// gflags_unittest.sh
|
||||
extern GFLAGS_DLL_DECL void GetAllFlags(std::vector<CommandLineFlagInfo>* OUTPUT);
|
||||
extern void GetAllFlags(std::vector<CommandLineFlagInfo>* OUTPUT);
|
||||
// These two are actually defined in gflags_reporting.cc.
|
||||
extern GFLAGS_DLL_DECL void ShowUsageWithFlags(const char *argv0); // what --help does
|
||||
extern GFLAGS_DLL_DECL void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict);
|
||||
extern void ShowUsageWithFlags(const char *argv0); // what --help does
|
||||
extern void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict);
|
||||
|
||||
// Create a descriptive string for a flag.
|
||||
// Goes to some trouble to make pretty line breaks.
|
||||
extern GFLAGS_DLL_DECL std::string DescribeOneFlag(const CommandLineFlagInfo& flag);
|
||||
extern std::string DescribeOneFlag(const CommandLineFlagInfo& flag);
|
||||
|
||||
// Thread-hostile; meant to be called before any threads are spawned.
|
||||
extern GFLAGS_DLL_DECL void SetArgv(int argc, const char** argv);
|
||||
extern void SetArgv(int argc, const char** argv);
|
||||
|
||||
// The following functions are thread-safe as long as SetArgv() is
|
||||
// only called before any threads start.
|
||||
extern GFLAGS_DLL_DECL const std::vector<std::string>& GetArgvs();
|
||||
extern GFLAGS_DLL_DECL const char* GetArgv(); // all of argv as a string
|
||||
extern GFLAGS_DLL_DECL const char* GetArgv0(); // only argv0
|
||||
extern GFLAGS_DLL_DECL uint32 GetArgvSum(); // simple checksum of argv
|
||||
extern GFLAGS_DLL_DECL const char* ProgramInvocationName(); // argv0, or "UNKNOWN" if not set
|
||||
extern GFLAGS_DLL_DECL const char* ProgramInvocationShortName(); // basename(argv0)
|
||||
extern const std::vector<std::string>& GetArgvs();
|
||||
extern const char* GetArgv(); // all of argv as a string
|
||||
extern const char* GetArgv0(); // only argv0
|
||||
extern uint32 GetArgvSum(); // simple checksum of argv
|
||||
extern const char* ProgramInvocationName(); // argv0, or "UNKNOWN" if not set
|
||||
extern const char* ProgramInvocationShortName(); // basename(argv0)
|
||||
|
||||
// ProgramUsage() is thread-safe as long as SetUsageMessage() is only
|
||||
// called before any threads start.
|
||||
extern GFLAGS_DLL_DECL const char* ProgramUsage(); // string set by SetUsageMessage()
|
||||
extern const char* ProgramUsage(); // string set by SetUsageMessage()
|
||||
|
||||
// VersionString() is thread-safe as long as SetVersionString() is only
|
||||
// called before any threads start.
|
||||
extern GFLAGS_DLL_DECL const char* VersionString(); // string set by SetVersionString()
|
||||
extern const char* VersionString(); // string set by SetVersionString()
|
||||
|
||||
|
||||
|
||||
@@ -211,16 +207,17 @@ extern GFLAGS_DLL_DECL const char* VersionString(); // string set
|
||||
|
||||
// Return true iff the flagname was found.
|
||||
// OUTPUT is set to the flag's value, or unchanged if we return false.
|
||||
extern GFLAGS_DLL_DECL bool GetCommandLineOption(const char* name, std::string* OUTPUT);
|
||||
extern bool GetCommandLineOption(const char* name, std::string* OUTPUT);
|
||||
|
||||
// Return true iff the flagname was found. OUTPUT is set to the flag's
|
||||
// CommandLineFlagInfo or unchanged if we return false.
|
||||
extern GFLAGS_DLL_DECL bool GetCommandLineFlagInfo(const char* name, CommandLineFlagInfo* OUTPUT);
|
||||
extern bool GetCommandLineFlagInfo(const char* name,
|
||||
CommandLineFlagInfo* OUTPUT);
|
||||
|
||||
// Return the CommandLineFlagInfo of the flagname. exit() if name not found.
|
||||
// Example usage, to check if a flag's value is currently the default value:
|
||||
// if (GetCommandLineFlagInfoOrDie("foo").is_default) ...
|
||||
extern GFLAGS_DLL_DECL CommandLineFlagInfo GetCommandLineFlagInfoOrDie(const char* name);
|
||||
extern CommandLineFlagInfo GetCommandLineFlagInfoOrDie(const char* name);
|
||||
|
||||
enum GFLAGS_DLL_DECL FlagSettingMode {
|
||||
// update the flag's value (can call this multiple times).
|
||||
@@ -242,8 +239,9 @@ enum GFLAGS_DLL_DECL FlagSettingMode {
|
||||
// non-empty else.
|
||||
|
||||
// SetCommandLineOption uses set_mode == SET_FLAGS_VALUE (the common case)
|
||||
extern GFLAGS_DLL_DECL std::string SetCommandLineOption (const char* name, const char* value);
|
||||
extern GFLAGS_DLL_DECL std::string SetCommandLineOptionWithMode(const char* name, const char* value, FlagSettingMode set_mode);
|
||||
extern std::string SetCommandLineOption(const char* name, const char* value);
|
||||
extern std::string SetCommandLineOptionWithMode(const char* name, const char* value,
|
||||
FlagSettingMode set_mode);
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -264,8 +262,8 @@ extern GFLAGS_DLL_DECL std::string SetCommandLineOptionWithMode(const char* name
|
||||
// // without worrying about restoring the FLAG values.
|
||||
// }
|
||||
//
|
||||
// Note: This class is marked with GFLAGS_ATTRIBUTE_UNUSED because all
|
||||
// the work is done in the constructor and destructor, so in the standard
|
||||
// Note: This class is marked with ATTRIBUTE_UNUSED because all the
|
||||
// work is done in the constructor and destructor, so in the standard
|
||||
// usage example above, the compiler would complain that it's an
|
||||
// unused variable.
|
||||
//
|
||||
@@ -284,23 +282,27 @@ class GFLAGS_DLL_DECL FlagSaver {
|
||||
|
||||
FlagSaver(const FlagSaver&); // no copying!
|
||||
void operator=(const FlagSaver&);
|
||||
};
|
||||
}
|
||||
#ifndef _MSC_VER
|
||||
__attribute__ ((unused))
|
||||
#endif
|
||||
;
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// Some deprecated or hopefully-soon-to-be-deprecated functions.
|
||||
|
||||
// This is often used for logging. TODO(csilvers): figure out a better way
|
||||
extern GFLAGS_DLL_DECL std::string CommandlineFlagsIntoString();
|
||||
extern std::string CommandlineFlagsIntoString();
|
||||
// Usually where this is used, a FlagSaver should be used instead.
|
||||
extern GFLAGS_DLL_DECL
|
||||
bool ReadFlagsFromString(const std::string& flagfilecontents,
|
||||
const char* prog_name,
|
||||
bool errors_are_fatal); // uses SET_FLAGS_VALUE
|
||||
extern bool ReadFlagsFromString(const std::string& flagfilecontents,
|
||||
const char* prog_name,
|
||||
bool errors_are_fatal); // uses SET_FLAGS_VALUE
|
||||
|
||||
// These let you manually implement --flagfile functionality.
|
||||
// DEPRECATED.
|
||||
extern GFLAGS_DLL_DECL bool AppendFlagsIntoFile(const std::string& filename, const char* prog_name);
|
||||
extern GFLAGS_DLL_DECL bool ReadFromFlagsFile(const std::string& filename, const char* prog_name, bool errors_are_fatal); // uses SET_FLAGS_VALUE
|
||||
extern bool AppendFlagsIntoFile(const std::string& filename, const char* prog_name);
|
||||
extern bool ReadFromFlagsFile(const std::string& filename, const char* prog_name,
|
||||
bool errors_are_fatal); // uses SET_FLAGS_VALUE
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -311,12 +313,12 @@ extern GFLAGS_DLL_DECL bool ReadFromFlagsFile(const std::string& filename, const
|
||||
// Otherwise, return the value. NOTE: for booleans, for true use
|
||||
// 't' or 'T' or 'true' or '1', for false 'f' or 'F' or 'false' or '0'.
|
||||
|
||||
extern GFLAGS_DLL_DECL bool BoolFromEnv(const char *varname, bool defval);
|
||||
extern GFLAGS_DLL_DECL int32 Int32FromEnv(const char *varname, int32 defval);
|
||||
extern GFLAGS_DLL_DECL int64 Int64FromEnv(const char *varname, int64 defval);
|
||||
extern GFLAGS_DLL_DECL uint64 Uint64FromEnv(const char *varname, uint64 defval);
|
||||
extern GFLAGS_DLL_DECL double DoubleFromEnv(const char *varname, double defval);
|
||||
extern GFLAGS_DLL_DECL const char *StringFromEnv(const char *varname, const char *defval);
|
||||
extern bool BoolFromEnv(const char *varname, bool defval);
|
||||
extern int32 Int32FromEnv(const char *varname, int32 defval);
|
||||
extern int64 Int64FromEnv(const char *varname, int64 defval);
|
||||
extern uint64 Uint64FromEnv(const char *varname, uint64 defval);
|
||||
extern double DoubleFromEnv(const char *varname, double defval);
|
||||
extern const char *StringFromEnv(const char *varname, const char *defval);
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -328,12 +330,12 @@ extern GFLAGS_DLL_DECL const char *StringFromEnv(const char *varname, const char
|
||||
// SetUsageMessage(usage);
|
||||
// Do not include commandline flags in the usage: we do that for you!
|
||||
// Thread-hostile; meant to be called before any threads are spawned.
|
||||
extern GFLAGS_DLL_DECL void SetUsageMessage(const std::string& usage);
|
||||
extern void SetUsageMessage(const std::string& usage);
|
||||
|
||||
// Sets the version string, which is emitted with --version.
|
||||
// For instance: SetVersionString("1.3");
|
||||
// Thread-hostile; meant to be called before any threads are spawned.
|
||||
extern GFLAGS_DLL_DECL void SetVersionString(const std::string& version);
|
||||
extern void SetVersionString(const std::string& version);
|
||||
|
||||
|
||||
// Looks for flags in argv and parses them. Rearranges argv to put
|
||||
@@ -343,7 +345,7 @@ extern GFLAGS_DLL_DECL void SetVersionString(const std::string& version);
|
||||
// of the first non-flag argument.
|
||||
// See top-of-file for more details on this function.
|
||||
#ifndef SWIG // In swig, use ParseCommandLineFlagsScript() instead.
|
||||
extern GFLAGS_DLL_DECL uint32 ParseCommandLineFlags(int *argc, char*** argv, bool remove_flags);
|
||||
extern uint32 ParseCommandLineFlags(int *argc, char*** argv, bool remove_flags);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -357,18 +359,18 @@ extern GFLAGS_DLL_DECL uint32 ParseCommandLineFlags(int *argc, char*** argv, boo
|
||||
// defined more than once in the command line or flag file, the last
|
||||
// definition is used. Returns the index (into argv) of the first
|
||||
// non-flag argument. (If remove_flags is true, will always return 1.)
|
||||
extern GFLAGS_DLL_DECL uint32 ParseCommandLineNonHelpFlags(int *argc, char*** argv, bool remove_flags);
|
||||
|
||||
extern uint32 ParseCommandLineNonHelpFlags(int *argc, char*** argv,
|
||||
bool remove_flags);
|
||||
// This is actually defined in gflags_reporting.cc.
|
||||
// This function is misnamed (it also handles --version, etc.), but
|
||||
// it's too late to change that now. :-(
|
||||
extern GFLAGS_DLL_DECL void HandleCommandLineHelpFlags(); // in gflags_reporting.cc
|
||||
extern void HandleCommandLineHelpFlags(); // in gflags_reporting.cc
|
||||
|
||||
// Allow command line reparsing. Disables the error normally
|
||||
// generated when an unknown flag is found, since it may be found in a
|
||||
// later parse. Thread-hostile; meant to be called before any threads
|
||||
// are spawned.
|
||||
extern GFLAGS_DLL_DECL void AllowCommandLineReparsing();
|
||||
extern void AllowCommandLineReparsing();
|
||||
|
||||
// Reparse the flags that have not yet been recognized. Only flags
|
||||
// registered since the last parse will be recognized. Any flag value
|
||||
@@ -376,7 +378,7 @@ extern GFLAGS_DLL_DECL void AllowCommandLineReparsing();
|
||||
// separate command line argument that follows the flag argument.
|
||||
// Intended for handling flags from dynamically loaded libraries,
|
||||
// since their flags are not registered until they are loaded.
|
||||
extern GFLAGS_DLL_DECL void ReparseCommandLineNonHelpFlags();
|
||||
extern void ReparseCommandLineNonHelpFlags();
|
||||
|
||||
// Clean up memory allocated by flags. This is only needed to reduce
|
||||
// the quantity of "potentially leaked" reports emitted by memory
|
||||
@@ -387,7 +389,7 @@ extern GFLAGS_DLL_DECL void ReparseCommandLineNonHelpFlags();
|
||||
// called will have unexpected consequences. This is not safe to run
|
||||
// when multiple threads might be running: the function is
|
||||
// thread-hostile.
|
||||
extern GFLAGS_DLL_DECL void ShutDownCommandLineFlags();
|
||||
extern void ShutDownCommandLineFlags();
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -418,7 +420,7 @@ extern GFLAGS_DLL_DECL void ShutDownCommandLineFlags();
|
||||
// directly. The idea is that DEFINE puts the flag in the weird
|
||||
// namespace, and DECLARE imports the flag from there into the current
|
||||
// namespace. The net result is to force people to use DECLARE to get
|
||||
// access to a flag, rather than saying "extern GFLAGS_DLL_DECL bool FLAGS_whatever;"
|
||||
// access to a flag, rather than saying "extern bool FLAGS_whatever;"
|
||||
// or some such instead. We want this so we can put extra
|
||||
// functionality (like sanity-checking) in DECLARE if we want, and
|
||||
// make sure it is picked up everywhere.
|
||||
@@ -439,18 +441,16 @@ class GFLAGS_DLL_DECL FlagRegisterer {
|
||||
// binary file. This can reduce the size of the resulting binary
|
||||
// somewhat, and may also be useful for security reasons.
|
||||
|
||||
extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[];
|
||||
|
||||
|
||||
} // namespace gflags
|
||||
extern const char kStrippedFlagHelp[];
|
||||
|
||||
}
|
||||
|
||||
#ifndef SWIG // In swig, ignore the main flag declarations
|
||||
|
||||
#if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0
|
||||
// Need this construct to avoid the 'defined but not used' warning.
|
||||
#define MAYBE_STRIPPED_HELP(txt) \
|
||||
(false ? (txt) : gflags::kStrippedFlagHelp)
|
||||
(false ? (txt) : ::google::kStrippedFlagHelp)
|
||||
#else
|
||||
#define MAYBE_STRIPPED_HELP(txt) txt
|
||||
#endif
|
||||
@@ -472,7 +472,7 @@ extern GFLAGS_DLL_DECL const char kStrippedFlagHelp[];
|
||||
/* We always want to export defined variables, dll or no */ \
|
||||
GFLAGS_DLL_DEFINE_FLAG type FLAGS_##name = FLAGS_nono##name; \
|
||||
type FLAGS_no##name = FLAGS_nono##name; \
|
||||
static gflags::FlagRegisterer o_##name( \
|
||||
static ::google::FlagRegisterer o_##name( \
|
||||
#name, #type, MAYBE_STRIPPED_HELP(help), __FILE__, \
|
||||
&FLAGS_##name, &FLAGS_no##name); \
|
||||
} \
|
||||
@@ -505,15 +505,15 @@ GFLAGS_DLL_DECL bool IsBoolFlag(bool from);
|
||||
DEFINE_VARIABLE(bool, B, name, val, txt)
|
||||
|
||||
#define DEFINE_int32(name, val, txt) \
|
||||
DEFINE_VARIABLE(gflags::int32, I, \
|
||||
DEFINE_VARIABLE(::google::int32, I, \
|
||||
name, val, txt)
|
||||
|
||||
#define DEFINE_int64(name, val, txt) \
|
||||
DEFINE_VARIABLE(gflags::int64, I64, \
|
||||
DEFINE_VARIABLE(::google::int64, I64, \
|
||||
name, val, txt)
|
||||
|
||||
#define DEFINE_uint64(name,val, txt) \
|
||||
DEFINE_VARIABLE(gflags::uint64, U64, \
|
||||
DEFINE_VARIABLE(::google::uint64, U64, \
|
||||
name, val, txt)
|
||||
|
||||
#define DEFINE_double(name, val, txt) \
|
||||
@@ -554,7 +554,7 @@ inline clstring* dont_pass0toDEFINE_string(char *stringspot,
|
||||
clstring* const FLAGS_no##name = ::fLS:: \
|
||||
dont_pass0toDEFINE_string(s_##name[0].s, \
|
||||
val); \
|
||||
static gflags::FlagRegisterer o_##name( \
|
||||
static ::google::FlagRegisterer o_##name( \
|
||||
#name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \
|
||||
s_##name[0].s, new (s_##name[1].s) clstring(*FLAGS_no##name)); \
|
||||
extern GFLAGS_DLL_DEFINE_FLAG clstring& FLAGS_##name; \
|
||||
@@ -565,4 +565,4 @@ inline clstring* dont_pass0toDEFINE_string(char *stringspot,
|
||||
|
||||
#endif // SWIG
|
||||
|
||||
#endif // GFLAGS_GFLAGS_H_
|
||||
#endif // BASE_COMMANDLINEFLAGS_H_
|
||||
|
@@ -109,13 +109,22 @@ $ complete -o bashdefault -o default -o nospace -C \
|
||||
// produce the expected completion output.
|
||||
|
||||
|
||||
#ifndef GFLAGS_COMPLETIONS_H_
|
||||
#define GFLAGS_COMPLETIONS_H_
|
||||
#ifndef BASE_COMMANDLINEFLAGS_COMPLETIONS_H_
|
||||
#define BASE_COMMANDLINEFLAGS_COMPLETIONS_H_
|
||||
|
||||
namespace gflags {
|
||||
// Annoying stuff for windows -- makes sure clients can import these functions
|
||||
//
|
||||
// NOTE: all functions below MUST have an explicit 'extern' before
|
||||
// them. Our automated opensourcing tools use this as a signal to do
|
||||
// appropriate munging for windows, which needs to add GFLAGS_DLL_DECL.
|
||||
//
|
||||
#define GFLAGS_DLL_DECL /* rewritten to be non-empty in windows dir */
|
||||
|
||||
|
||||
namespace google {
|
||||
|
||||
extern void HandleCommandLineCompletions(void);
|
||||
|
||||
}
|
||||
|
||||
#endif // GFLAGS_COMPLETIONS_H_
|
||||
#endif // BASE_COMMANDLINEFLAGS_COMPLETIONS_H_
|
||||
|
@@ -34,64 +34,43 @@
|
||||
// This is the file that should be included by any file which declares
|
||||
// command line flag.
|
||||
|
||||
#ifndef GFLAGS_DECLARE_H_
|
||||
#define GFLAGS_DECLARE_H_
|
||||
#ifndef BASE_COMMANDLINEFLAGS_DECLARE_H_
|
||||
#define BASE_COMMANDLINEFLAGS_DECLARE_H_
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Windows DLL import/export.
|
||||
|
||||
// We always want to import the symbols of the gflags library
|
||||
#ifndef GFLAGS_DLL_DECL
|
||||
# if 0 && defined(_MSC_VER)
|
||||
# define GFLAGS_DLL_DECL __declspec(dllimport)
|
||||
# else
|
||||
# define GFLAGS_DLL_DECL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// We always want to import variables declared in user code
|
||||
#ifndef GFLAGS_DLL_DECLARE_FLAG
|
||||
# if 0 && defined(_MSC_VER)
|
||||
# define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport)
|
||||
# else
|
||||
# define GFLAGS_DLL_DECLARE_FLAG
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Flag types
|
||||
#include <string>
|
||||
#if 1
|
||||
# include <stdint.h> // the normal place uint32_t is defined
|
||||
#elif 1
|
||||
# include <sys/types.h> // the normal place u_int32_t is defined
|
||||
#elif 1
|
||||
# include <inttypes.h> // a third place for uint32_t or u_int32_t
|
||||
#include <stdint.h> // the normal place uint16_t is defined
|
||||
#endif
|
||||
#if 1
|
||||
#include <sys/types.h> // the normal place u_int16_t is defined
|
||||
#endif
|
||||
#if 1
|
||||
#include <inttypes.h> // a third place for uint16_t or u_int16_t
|
||||
#endif
|
||||
|
||||
namespace gflags {
|
||||
|
||||
#if 1 // C99
|
||||
typedef int32_t int32;
|
||||
typedef uint32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
#elif 0 // BSD
|
||||
typedef int32_t int32;
|
||||
typedef u_int32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef u_int64_t uint64;
|
||||
#elif 0 // Windows
|
||||
typedef __int32 int32;
|
||||
namespace google {
|
||||
#if defined(__GNUC__) || defined(__MINGW32__) // the C99 format
|
||||
typedef int32_t int32;
|
||||
typedef uint32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) // the BSD format
|
||||
typedef int32_t int32;
|
||||
typedef u_int32_t uint32;
|
||||
typedef int64_t int64;
|
||||
typedef u_int64_t uint64;
|
||||
#elif defined(_MSC_VER) // the windows (vc7) format
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
#else
|
||||
# error Do not know how to define a 32-bit integer quantity on your system
|
||||
#error Do not know how to define a 32-bit integer quantity on your system
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace gflags
|
||||
|
||||
#define GFLAGS_DLL_DECLARE_FLAG /* rewritten to be non-empty in windows dir */
|
||||
|
||||
namespace fLS {
|
||||
|
||||
@@ -101,8 +80,7 @@ namespace fLS {
|
||||
// included). Save the current meaning now and use it in the macros.
|
||||
typedef std::string clstring;
|
||||
|
||||
} // namespace fLS
|
||||
|
||||
}
|
||||
|
||||
#define DECLARE_VARIABLE(type, shorttype, name) \
|
||||
/* We always want to import declared variables, dll or no */ \
|
||||
@@ -113,24 +91,22 @@ typedef std::string clstring;
|
||||
DECLARE_VARIABLE(bool, B, name)
|
||||
|
||||
#define DECLARE_int32(name) \
|
||||
DECLARE_VARIABLE(::gflags::int32, I, name)
|
||||
DECLARE_VARIABLE(::google::int32, I, name)
|
||||
|
||||
#define DECLARE_int64(name) \
|
||||
DECLARE_VARIABLE(::gflags::int64, I64, name)
|
||||
DECLARE_VARIABLE(::google::int64, I64, name)
|
||||
|
||||
#define DECLARE_uint64(name) \
|
||||
DECLARE_VARIABLE(::gflags::uint64, U64, name)
|
||||
DECLARE_VARIABLE(::google::uint64, U64, name)
|
||||
|
||||
#define DECLARE_double(name) \
|
||||
DECLARE_VARIABLE(double, D, name)
|
||||
|
||||
#define DECLARE_string(name) \
|
||||
/* We always want to import declared variables, dll or no */ \
|
||||
namespace fLS { \
|
||||
using ::fLS::clstring; \
|
||||
namespace fLS { \
|
||||
using ::fLS::clstring; \
|
||||
extern GFLAGS_DLL_DECLARE_FLAG ::fLS::clstring& FLAGS_##name; \
|
||||
} \
|
||||
} \
|
||||
using fLS::FLAGS_##name
|
||||
|
||||
|
||||
#endif // GFLAGS_DECLARE_H_
|
||||
#endif // BASE_COMMANDLINEFLAGS_DECLARE_H_
|
||||
|
@@ -48,7 +48,6 @@
|
||||
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h> // for strlen
|
||||
@@ -58,13 +57,17 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "gflags.h"
|
||||
#include "gflags/gflags_completions.h"
|
||||
#include "gflags/gflags.h"
|
||||
#include "util.h"
|
||||
|
||||
using std::set;
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
#ifndef PATH_SEPARATOR
|
||||
#define PATH_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
DEFINE_string(tab_completion_word, "",
|
||||
"If non-empty, HandleCommandLineCompletions() will hijack the "
|
||||
@@ -73,9 +76,7 @@ DEFINE_string(tab_completion_word, "",
|
||||
DEFINE_int32(tab_completion_columns, 80,
|
||||
"Number of columns to use in output for tab completion");
|
||||
|
||||
|
||||
namespace GFLAGS_NAMESPACE {
|
||||
|
||||
_START_GOOGLE_NAMESPACE_
|
||||
|
||||
namespace {
|
||||
// Function prototypes and Type forward declarations. Code may be
|
||||
@@ -765,5 +766,4 @@ void HandleCommandLineCompletions(void) {
|
||||
gflags_exitfunc(0);
|
||||
}
|
||||
|
||||
|
||||
} // namespace GFLAGS_NAMESPACE
|
||||
_END_GOOGLE_NAMESPACE_
|
||||
|
@@ -48,32 +48,40 @@
|
||||
// called after all flag-values have been assigned, that is, after
|
||||
// parsing the command-line.
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "config.h"
|
||||
#include "gflags.h"
|
||||
#include "gflags_completions.h"
|
||||
#include "gflags/gflags.h"
|
||||
#include "gflags/gflags_completions.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifndef PATH_SEPARATOR
|
||||
#define PATH_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
// The 'reporting' flags. They all call gflags_exitfunc().
|
||||
DEFINE_bool (help, false, "show help on all flags [tip: all flags can have two dashes]");
|
||||
DEFINE_bool (helpfull, false, "show help on all flags -- same as -help");
|
||||
DEFINE_bool (helpshort, false, "show help on only the main module for this program");
|
||||
DEFINE_string(helpon, "", "show help on the modules named by this flag value");
|
||||
DEFINE_string(helpmatch, "", "show help on modules whose name contains the specified substr");
|
||||
DEFINE_bool (helppackage, false, "show help on all modules in the main package");
|
||||
DEFINE_bool (helpxml, false, "produce an xml version of help");
|
||||
DEFINE_bool (version, false, "show version and build info and exit");
|
||||
|
||||
|
||||
namespace GFLAGS_NAMESPACE {
|
||||
DEFINE_bool(help, false,
|
||||
"show help on all flags [tip: all flags can have two dashes]");
|
||||
DEFINE_bool(helpfull, false,
|
||||
"show help on all flags -- same as -help");
|
||||
DEFINE_bool(helpshort, false,
|
||||
"show help on only the main module for this program");
|
||||
DEFINE_string(helpon, "",
|
||||
"show help on the modules named by this flag value");
|
||||
DEFINE_string(helpmatch, "",
|
||||
"show help on modules whose name contains the specified substr");
|
||||
DEFINE_bool(helppackage, false,
|
||||
"show help on all modules in the main package");
|
||||
DEFINE_bool(helpxml, false,
|
||||
"produce an xml version of help");
|
||||
DEFINE_bool(version, false,
|
||||
"show version and build info and exit");
|
||||
|
||||
_START_GOOGLE_NAMESPACE_
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
@@ -246,7 +254,7 @@ static bool FileMatchesSubstring(const string& filename,
|
||||
// the string to be at the beginning of a directory component.
|
||||
// That should match the first directory component as well, so
|
||||
// we allow '/foo' to match a filename of 'foo'.
|
||||
if (!target->empty() && (*target)[0] == PATH_SEPARATOR &&
|
||||
if (!target->empty() && (*target)[0] == '/' &&
|
||||
strncmp(filename.c_str(), target->c_str() + 1,
|
||||
strlen(target->c_str() + 1)) == 0)
|
||||
return true;
|
||||
@@ -352,8 +360,7 @@ static void ShowVersion() {
|
||||
|
||||
static void AppendPrognameStrings(vector<string>* substrings,
|
||||
const char* progname) {
|
||||
string r("");
|
||||
r += PATH_SEPARATOR;
|
||||
string r("/");
|
||||
r += progname;
|
||||
substrings->push_back(r + ".");
|
||||
substrings->push_back(r + "-main.");
|
||||
@@ -388,7 +395,7 @@ void HandleCommandLineHelpFlags() {
|
||||
gflags_exitfunc(1);
|
||||
|
||||
} else if (!FLAGS_helpon.empty()) {
|
||||
string restrict = PATH_SEPARATOR + FLAGS_helpon + ".";
|
||||
string restrict = "/" + FLAGS_helpon + ".";
|
||||
ShowUsageWithFlagsRestrict(progname, restrict.c_str());
|
||||
gflags_exitfunc(1);
|
||||
|
||||
@@ -410,7 +417,7 @@ void HandleCommandLineHelpFlags() {
|
||||
++flag) {
|
||||
if (!FileMatchesSubstring(flag->filename, substrings))
|
||||
continue;
|
||||
const string package = Dirname(flag->filename) + PATH_SEPARATOR;
|
||||
const string package = Dirname(flag->filename) + "/";
|
||||
if (package != last_package) {
|
||||
ShowUsageWithFlagsRestrict(progname, package.c_str());
|
||||
VLOG(7) << "Found package: " << package;
|
||||
@@ -437,5 +444,4 @@ void HandleCommandLineHelpFlags() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // namespace GFLAGS_NAMESPACE
|
||||
_END_GOOGLE_NAMESPACE_
|
||||
|
19
extern/libmv/third_party/gflags/mutex.h
vendored
19
extern/libmv/third_party/gflags/mutex.h
vendored
@@ -32,6 +32,11 @@
|
||||
// A simple mutex wrapper, supporting locks and read-write locks.
|
||||
// You should assume the locks are *not* re-entrant.
|
||||
//
|
||||
// To use: you should define the following macros in your configure.ac:
|
||||
// ACX_PTHREAD
|
||||
// AC_RWLOCK
|
||||
// The latter is defined in ../autoconf.
|
||||
//
|
||||
// This class is meant to be internal-only and should be wrapped by an
|
||||
// internal namespace. Before you use this module, please give the
|
||||
// name of your internal namespace for this module. Or, if you want
|
||||
@@ -103,14 +108,14 @@
|
||||
// weird to a Mutex's memory after it is destroyed, but for a
|
||||
// static global variable, that's pretty safe.
|
||||
|
||||
#ifndef GFLAGS_MUTEX_H_
|
||||
#define GFLAGS_MUTEX_H_
|
||||
#ifndef GOOGLE_MUTEX_H_
|
||||
#define GOOGLE_MUTEX_H_
|
||||
|
||||
#include "gflags_declare.h" // to figure out pthreads support
|
||||
#include "config.h" // to figure out pthreads support
|
||||
|
||||
#if defined(NO_THREADS)
|
||||
typedef int MutexType; // to keep a lock-count
|
||||
#elif defined(OS_WINDOWS)
|
||||
typedef int MutexType; // to keep a lock-count
|
||||
#elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN // We only need minimal includes
|
||||
# endif
|
||||
@@ -227,7 +232,7 @@ bool Mutex::TryLock() { if (mutex_) return false; Lock(); return true; }
|
||||
void Mutex::ReaderLock() { assert(++mutex_ > 0); }
|
||||
void Mutex::ReaderUnlock() { assert(mutex_-- > 0); }
|
||||
|
||||
#elif defined(OS_WINDOWS)
|
||||
#elif defined(_WIN32) || defined(__CYGWIN32__) || defined(__CYGWIN64__)
|
||||
|
||||
Mutex::Mutex() : destroy_(true) {
|
||||
InitializeCriticalSection(&mutex_);
|
||||
@@ -348,4 +353,4 @@ using namespace MUTEX_NAMESPACE;
|
||||
|
||||
#undef MUTEX_NAMESPACE
|
||||
|
||||
#endif /* #define GFLAGS_MUTEX_H__ */
|
||||
#endif /* #define GOOGLE_MUTEX_H__ */
|
||||
|
114
extern/libmv/third_party/gflags/util.h
vendored
114
extern/libmv/third_party/gflags/util.h
vendored
@@ -34,53 +34,48 @@
|
||||
#ifndef GFLAGS_UTIL_H_
|
||||
#define GFLAGS_UTIL_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#include <stdarg.h> // for va_*
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h> // for mkdir
|
||||
#endif
|
||||
|
||||
|
||||
namespace GFLAGS_NAMESPACE {
|
||||
# include <sys/stat.h>
|
||||
#endif // for mkdir()
|
||||
|
||||
_START_GOOGLE_NAMESPACE_
|
||||
|
||||
// This is used for unittests for death-testing. It is defined in gflags.cc.
|
||||
extern GFLAGS_DLL_DECL void (*gflags_exitfunc)(int);
|
||||
|
||||
// Work properly if either strtoll or strtoq is on this system.
|
||||
#if defined(strtoll) || defined(HAVE_STRTOLL)
|
||||
# define strto64 strtoll
|
||||
# define strtou64 strtoull
|
||||
#elif defined(HAVE_STRTOQ)
|
||||
# define strto64 strtoq
|
||||
# define strtou64 strtouq
|
||||
// Neither strtoll nor strtoq are defined. I hope strtol works!
|
||||
// Work properly if either strtoll or strtoq is on this system
|
||||
#ifdef HAVE_STRTOLL
|
||||
# define strto64 strtoll
|
||||
# define strtou64 strtoull
|
||||
#elif HAVE_STRTOQ
|
||||
# define strto64 strtoq
|
||||
# define strtou64 strtouq
|
||||
#else
|
||||
# define strto64 strtol
|
||||
# define strtou64 strtoul
|
||||
// Neither strtoll nor strtoq are defined. I hope strtol works!
|
||||
# define strto64 strtol
|
||||
# define strtou64 strtoul
|
||||
#endif
|
||||
|
||||
// If we have inttypes.h, it will have defined PRId32/etc for us.
|
||||
// If not, take our best guess.
|
||||
// If we have inttypes.h, it will have defined PRId32/etc for us. If
|
||||
// not, take our best guess.
|
||||
#ifndef PRId32
|
||||
# define PRId32 "d"
|
||||
# define PRId32 "d"
|
||||
#endif
|
||||
#ifndef PRId64
|
||||
# define PRId64 "lld"
|
||||
# define PRId64 "lld"
|
||||
#endif
|
||||
#ifndef PRIu64
|
||||
# define PRIu64 "llu"
|
||||
# define PRIu64 "llu"
|
||||
#endif
|
||||
|
||||
typedef signed char int8;
|
||||
@@ -235,36 +230,37 @@ class Test {};
|
||||
#if defined(__MINGW32__)
|
||||
#include <io.h>
|
||||
inline void MakeTmpdir(std::string* path) {
|
||||
if (!path->empty()) {
|
||||
path->append("/gflags_unittest_testdir");
|
||||
int err = mkdir(path->c_str());
|
||||
if (err == 0 || errno == EEXIST) return;
|
||||
}
|
||||
// I had trouble creating a directory in /tmp from mingw
|
||||
*path = "./gflags_unittest";
|
||||
mkdir(path->c_str());
|
||||
*path = "./gflags_unittest_testdir";
|
||||
mkdir(path->c_str()); // mingw has a weird one-arg mkdir
|
||||
}
|
||||
#elif defined(_MSC_VER)
|
||||
#include <direct.h>
|
||||
#include <windows.h>
|
||||
inline void MakeTmpdir(std::string* path) {
|
||||
if (!path->empty()) {
|
||||
int err = _mkdir(path->c_str());
|
||||
if (err == 0 || errno == EEXIST) return;
|
||||
}
|
||||
char tmppath_buffer[1024];
|
||||
int tmppath_len = GetTempPathA(sizeof(tmppath_buffer), tmppath_buffer);
|
||||
assert(tmppath_len > 0 && tmppath_len < sizeof(tmppath_buffer));
|
||||
assert(tmppath_buffer[tmppath_len - 1] == '\\'); // API guarantees it
|
||||
*path = std::string(tmppath_buffer) + "gflags_unittest";
|
||||
*path = std::string(tmppath_buffer) + "gflags_unittest_testdir";
|
||||
_mkdir(path->c_str());
|
||||
}
|
||||
// Windows is missing random bits like strcasecmp, strtoll, strtoull, and
|
||||
// snprintf in the usual locations. Put them somewhere sensible.
|
||||
//
|
||||
// TODO(keir): Get the upstream Windows port and use that instead.
|
||||
#define snprintf _snprintf
|
||||
#undef strtoint64
|
||||
#define strtoint64 _strtoi64
|
||||
#undef strtouint64
|
||||
#define strtouint64 _strtoui64
|
||||
#define strcasecmp _stricmp
|
||||
#define va_copy(dst, src) ((dst) = (src))
|
||||
#define strto64 _strtoi64
|
||||
#define strtou64 _strtoui64
|
||||
#else
|
||||
inline void MakeTmpdir(std::string* path) {
|
||||
if (!path->empty()) {
|
||||
int err = mkdir(path->c_str(), 0755);
|
||||
if (err == 0 || errno == EEXIST) return;
|
||||
}
|
||||
mkdir("/tmp/gflags_unittest", 0755);
|
||||
mkdir(path->c_str(), 0755);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -282,7 +278,7 @@ inline void InternalStringPrintf(std::string* output, const char* format,
|
||||
int bytes_written = vsnprintf(space, sizeof(space), format, backup_ap);
|
||||
va_end(backup_ap);
|
||||
|
||||
if ((bytes_written >= 0) && (static_cast<size_t>(bytes_written) < sizeof(space))) {
|
||||
if ((bytes_written >= 0) && (bytes_written < sizeof(space))) {
|
||||
output->append(space, bytes_written);
|
||||
return;
|
||||
}
|
||||
@@ -338,36 +334,6 @@ inline std::string StringPrintf(const char* format, ...) {
|
||||
return output;
|
||||
}
|
||||
|
||||
inline bool SafeGetEnv(const char *varname, std::string &valstr)
|
||||
{
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
char *val;
|
||||
size_t sz;
|
||||
if (_dupenv_s(&val, &sz, varname) != 0 || !val) return false;
|
||||
valstr = val;
|
||||
free(val);
|
||||
#else
|
||||
const char * const val = getenv(varname);
|
||||
if (!val) return false;
|
||||
valstr = val;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
inline int SafeFOpen(FILE **fp, const char* fname, const char *mode)
|
||||
{
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
return fopen_s(fp, fname, mode);
|
||||
#else
|
||||
assert(fp != NULL);
|
||||
*fp = fopen(fname, mode);
|
||||
// errno only guaranteed to be set on failure
|
||||
return ((*fp == NULL) ? errno : 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
} // namespace GFLAGS_NAMESPACE
|
||||
|
||||
_END_GOOGLE_NAMESPACE_
|
||||
|
||||
#endif // GFLAGS_UTIL_H_
|
||||
|
71
extern/libmv/third_party/gflags/windows_port.cc
vendored
71
extern/libmv/third_party/gflags/windows_port.cc
vendored
@@ -1,71 +0,0 @@
|
||||
/* Copyright (c) 2009, Google Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ---
|
||||
* Author: Craig Silverstein
|
||||
*/
|
||||
|
||||
#ifndef _WIN32
|
||||
# error You should only be including windows/port.cc in a windows environment!
|
||||
#endif
|
||||
|
||||
#include <string.h> // for strlen(), memset(), memcmp()
|
||||
#include <assert.h>
|
||||
#include <stdarg.h> // for va_list, va_start, va_end
|
||||
#include <windows.h>
|
||||
|
||||
#include "windows_port.h"
|
||||
|
||||
// These call the windows _vsnprintf, but always NUL-terminate.
|
||||
#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4996) // ignore _vsnprintf security warning
|
||||
#endif
|
||||
int safe_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
||||
if (size == 0) // not even room for a \0?
|
||||
return -1; // not what C99 says to do, but what windows does
|
||||
str[size-1] = '\0';
|
||||
return _vsnprintf(str, size-1, format, ap);
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
int snprintf(char *str, size_t size, const char *format, ...) {
|
||||
int r;
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
r = vsnprintf(str, size, format, ap);
|
||||
va_end(ap);
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */
|
127
extern/libmv/third_party/gflags/windows_port.h
vendored
127
extern/libmv/third_party/gflags/windows_port.h
vendored
@@ -1,127 +0,0 @@
|
||||
/* Copyright (c) 2009, Google Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name of Google Inc. nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ---
|
||||
* Author: Craig Silverstein
|
||||
*
|
||||
* These are some portability typedefs and defines to make it a bit
|
||||
* easier to compile this code under VC++.
|
||||
*
|
||||
* Several of these are taken from glib:
|
||||
* http://developer.gnome.org/doc/API/glib/glib-windows-compatability-functions.html
|
||||
*/
|
||||
|
||||
#ifndef GFLAGS_WINDOWS_PORT_H_
|
||||
#define GFLAGS_WINDOWS_PORT_H_
|
||||
|
||||
#include "config.h"
|
||||
|
||||
// This must be defined before the windows.h is included.
|
||||
// It's needed for mutex.h, to give access to the TryLock method.
|
||||
# if !defined(_WIN32_WINNT) && !(defined( __MINGW32__) || defined(__MINGW64__))
|
||||
# define _WIN32_WINNT 0x0400
|
||||
# endif
|
||||
// We always want minimal includes
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#include <direct.h> /* for mkdir */
|
||||
#include <stdlib.h> /* for _putenv, getenv */
|
||||
#include <stdio.h> /* need this to override stdio's snprintf, also defines _unlink used by unit tests */
|
||||
#include <stdarg.h> /* util.h uses va_copy */
|
||||
#include <string.h> /* for _stricmp and _strdup */
|
||||
|
||||
/* We can't just use _vsnprintf and _snprintf as drop-in-replacements,
|
||||
* because they don't always NUL-terminate. :-( We also can't use the
|
||||
* name vsnprintf, since windows defines that (but not snprintf (!)).
|
||||
*/
|
||||
#if !defined(__MINGW32__) && !defined(__MINGW64__) /* mingw already defines */
|
||||
extern GFLAGS_DLL_DECL int snprintf(char *str, size_t size,
|
||||
const char *format, ...);
|
||||
extern int GFLAGS_DLL_DECL safe_vsnprintf(char *str, size_t size,
|
||||
const char *format, va_list ap);
|
||||
#define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
|
||||
#define va_copy(dst, src) (dst) = (src)
|
||||
#endif /* #if !defined(__MINGW32__) && !defined(__MINGW64__) */
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable: 4996) // ignore getenv security warning
|
||||
#endif
|
||||
inline void setenv(const char* name, const char* value, int) {
|
||||
// In windows, it's impossible to set a variable to the empty string.
|
||||
// We handle this by setting it to "0" and the NUL-ing out the \0.
|
||||
// That is, we putenv("FOO=0") and then find out where in memory the
|
||||
// putenv wrote "FOO=0", and change it in-place to "FOO=\0".
|
||||
// c.f. http://svn.apache.org/viewvc/stdcxx/trunk/tests/src/environ.cpp?r1=611451&r2=637508&pathrev=637508
|
||||
static const char* const kFakeZero = "0";
|
||||
if (*value == '\0')
|
||||
value = kFakeZero;
|
||||
// Apparently the semantics of putenv() is that the input
|
||||
// must live forever, so we leak memory here. :-(
|
||||
const size_t nameval_len = strlen(name) + 1 + strlen(value) + 1;
|
||||
char* nameval = reinterpret_cast<char*>(malloc(nameval_len));
|
||||
snprintf(nameval, nameval_len, "%s=%s", name, value);
|
||||
_putenv(nameval);
|
||||
if (value == kFakeZero) {
|
||||
nameval[nameval_len - 2] = '\0'; // works when putenv() makes no copy
|
||||
if (*getenv(name) != '\0')
|
||||
*getenv(name) = '\0'; // works when putenv() copies nameval
|
||||
}
|
||||
}
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#define strcasecmp _stricmp
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1400
|
||||
#define strdup _strdup
|
||||
#define unlink _unlink
|
||||
#endif
|
||||
|
||||
#define PRId32 "d"
|
||||
#define PRIu32 "u"
|
||||
#define PRId64 "I64d"
|
||||
#define PRIu64 "I64u"
|
||||
|
||||
#if !defined(__MINGW32__) && !defined(__MINGW64__)
|
||||
#define strtoq _strtoi64
|
||||
#define strtouq _strtoui64
|
||||
#define strtoll _strtoi64
|
||||
#define strtoull _strtoui64
|
||||
#define atoll _atoi64
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
#endif /* GFLAGS_WINDOWS_PORT_H_ */
|
2
extern/libmv/third_party/glog/README.libmv
vendored
2
extern/libmv/third_party/glog/README.libmv
vendored
@@ -1,7 +1,7 @@
|
||||
Project: Google Logging
|
||||
URL: http://code.google.com/p/google-glog/
|
||||
License: New BSD
|
||||
Upstream version: 0.3.3, r143
|
||||
Upstream version: 0.3.3, r139
|
||||
Local modifications:
|
||||
* Added per-platform config.h files so no configuration-time
|
||||
checks for functions and so are needed.
|
||||
|
@@ -167,7 +167,7 @@ static size_t StrLen(const char *str) {
|
||||
// Returns true if "str" has at least "n" characters remaining.
|
||||
static bool AtLeastNumCharsRemaining(const char *str, int n) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
if (str[i] == '\0') {
|
||||
if (str == '\0') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -223,6 +223,9 @@ static bool ParseTwoCharToken(State *state, const char *two_char_token) {
|
||||
// Returns true and advances "mangled_cur" if we find any character in
|
||||
// "char_class" at "mangled_cur" position.
|
||||
static bool ParseCharClass(State *state, const char *char_class) {
|
||||
if (state->mangled_cur == '\0') {
|
||||
return false;
|
||||
}
|
||||
const char *p = char_class;
|
||||
for (; *p != '\0'; ++p) {
|
||||
if (state->mangled_cur[0] == *p) {
|
||||
|
5
extern/libmv/third_party/glog/src/logging.cc
vendored
5
extern/libmv/third_party/glog/src/logging.cc
vendored
@@ -31,7 +31,6 @@
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
@@ -182,10 +181,6 @@ GLOG_DEFINE_string(log_backtrace_at, "",
|
||||
#define PATH_SEPARATOR '/'
|
||||
|
||||
#ifndef HAVE_PREAD
|
||||
#if defined(OS_WINDOWS)
|
||||
#include <BaseTsd.h>
|
||||
#define ssize_t SSIZE_T
|
||||
#endif
|
||||
static ssize_t pread(int fd, void* buf, size_t count, off_t offset) {
|
||||
off_t orig_offset = lseek(fd, 0, SEEK_CUR);
|
||||
if (orig_offset == (off_t)-1)
|
||||
|
239
extern/libmv/third_party/glog/src/symbolize.cc
vendored
239
extern/libmv/third_party/glog/src/symbolize.cc
vendored
@@ -45,12 +45,6 @@
|
||||
// some functions which are not guaranteed to be so, such as memchr()
|
||||
// and memmove(). We assume they are async-signal-safe.
|
||||
//
|
||||
// Additional header can be specified by the GLOG_BUILD_CONFIG_INCLUDE
|
||||
// macro to add platform specific defines (e.g. OS_OPENBSD).
|
||||
|
||||
#ifdef GLOG_BUILD_CONFIG_INCLUDE
|
||||
#include GLOG_BUILD_CONFIG_INCLUDE
|
||||
#endif // GLOG_BUILD_CONFIG_INCLUDE
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
@@ -80,13 +74,6 @@ void InstallSymbolizeCallback(SymbolizeCallback callback) {
|
||||
g_symbolize_callback = callback;
|
||||
}
|
||||
|
||||
static SymbolizeOpenObjectFileCallback g_symbolize_open_object_file_callback =
|
||||
NULL;
|
||||
void InstallSymbolizeOpenObjectFileCallback(
|
||||
SymbolizeOpenObjectFileCallback callback) {
|
||||
g_symbolize_open_object_file_callback = callback;
|
||||
}
|
||||
|
||||
// This function wraps the Demangle function to provide an interface
|
||||
// where the input symbol is demangled in-place.
|
||||
// To keep stack consumption low, we would like this function to not
|
||||
@@ -108,14 +95,11 @@ _END_GOOGLE_NAMESPACE_
|
||||
#if defined(__ELF__)
|
||||
|
||||
#include <dlfcn.h>
|
||||
#if defined(OS_OPENBSD)
|
||||
#include <sys/exec_elf.h>
|
||||
#else
|
||||
#include <elf.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <link.h> // For ElfW() macro.
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -139,7 +123,7 @@ _START_GOOGLE_NAMESPACE_
|
||||
// success, return the number of bytes read. Otherwise, return -1.
|
||||
static ssize_t ReadPersistent(const int fd, void *buf, const size_t count) {
|
||||
SAFE_ASSERT(fd >= 0);
|
||||
SAFE_ASSERT(count <= std::numeric_limits<ssize_t>::max());
|
||||
SAFE_ASSERT(count >= 0 && count <= std::numeric_limits<ssize_t>::max());
|
||||
char *buf0 = reinterpret_cast<char *>(buf);
|
||||
ssize_t num_bytes = 0;
|
||||
while (num_bytes < count) {
|
||||
@@ -342,29 +326,31 @@ static bool GetSymbolFromObjectFile(const int fd, uint64_t pc,
|
||||
ElfW(Shdr) symtab, strtab;
|
||||
|
||||
// Consult a regular symbol table first.
|
||||
if (GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff,
|
||||
SHT_SYMTAB, &symtab)) {
|
||||
if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff +
|
||||
symtab.sh_link * sizeof(symtab))) {
|
||||
return false;
|
||||
}
|
||||
if (FindSymbol(pc, fd, out, out_size, symbol_offset,
|
||||
&strtab, &symtab)) {
|
||||
return true; // Found the symbol in a regular symbol table.
|
||||
}
|
||||
if (!GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff,
|
||||
SHT_SYMTAB, &symtab)) {
|
||||
return false;
|
||||
}
|
||||
if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff +
|
||||
symtab.sh_link * sizeof(symtab))) {
|
||||
return false;
|
||||
}
|
||||
if (FindSymbol(pc, fd, out, out_size, symbol_offset,
|
||||
&strtab, &symtab)) {
|
||||
return true; // Found the symbol in a regular symbol table.
|
||||
}
|
||||
|
||||
// If the symbol is not found, then consult a dynamic symbol table.
|
||||
if (GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff,
|
||||
SHT_DYNSYM, &symtab)) {
|
||||
if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff +
|
||||
symtab.sh_link * sizeof(symtab))) {
|
||||
return false;
|
||||
}
|
||||
if (FindSymbol(pc, fd, out, out_size, symbol_offset,
|
||||
&strtab, &symtab)) {
|
||||
return true; // Found the symbol in a dynamic symbol table.
|
||||
}
|
||||
if (!GetSectionHeaderByType(fd, elf_header.e_shnum, elf_header.e_shoff,
|
||||
SHT_DYNSYM, &symtab)) {
|
||||
return false;
|
||||
}
|
||||
if (!ReadFromOffsetExact(fd, &strtab, sizeof(strtab), elf_header.e_shoff +
|
||||
symtab.sh_link * sizeof(symtab))) {
|
||||
return false;
|
||||
}
|
||||
if (FindSymbol(pc, fd, out, out_size, symbol_offset,
|
||||
&strtab, &symtab)) {
|
||||
return true; // Found the symbol in a dynamic symbol table.
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -495,20 +481,13 @@ static char *GetHex(const char *start, const char *end, uint64_t *hex) {
|
||||
return const_cast<char *>(p);
|
||||
}
|
||||
|
||||
// Searches for the object file (from /proc/self/maps) that contains
|
||||
// the specified pc. If found, sets |start_address| to the start address
|
||||
// of where this object file is mapped in memory, sets the module base
|
||||
// address into |base_address|, copies the object file name into
|
||||
// |out_file_name|, and attempts to open the object file. If the object
|
||||
// file is opened successfully, returns the file descriptor. Otherwise,
|
||||
// returns -1. |out_file_name_size| is the size of the file name buffer
|
||||
// (including the null-terminator).
|
||||
// Search for the object file (from /proc/self/maps) that contains
|
||||
// the specified pc. If found, open this file and return the file handle,
|
||||
// and also set start_address to the start address of where this object
|
||||
// file is mapped to in memory. Otherwise, return -1.
|
||||
static ATTRIBUTE_NOINLINE int
|
||||
OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
|
||||
uint64_t &start_address,
|
||||
uint64_t &base_address,
|
||||
char *out_file_name,
|
||||
int out_file_name_size) {
|
||||
uint64_t &start_address) {
|
||||
int object_fd;
|
||||
|
||||
// Open /proc/self/maps.
|
||||
@@ -522,10 +501,8 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
|
||||
// Iterate over maps and look for the map containing the pc. Then
|
||||
// look into the symbol tables inside.
|
||||
char buf[1024]; // Big enough for line of sane /proc/self/maps
|
||||
int num_maps = 0;
|
||||
LineReader reader(wrapped_maps_fd.get(), buf, sizeof(buf));
|
||||
while (true) {
|
||||
num_maps++;
|
||||
const char *cursor;
|
||||
const char *eol;
|
||||
if (!reader.ReadLine(&cursor, &eol)) { // EOF or malformed line.
|
||||
@@ -575,35 +552,14 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
|
||||
}
|
||||
++cursor; // Skip ' '.
|
||||
|
||||
// Read file offset.
|
||||
uint64_t file_offset;
|
||||
cursor = GetHex(cursor, eol, &file_offset);
|
||||
if (cursor == eol || *cursor != ' ') {
|
||||
return -1; // Malformed line.
|
||||
}
|
||||
++cursor; // Skip ' '.
|
||||
|
||||
// Don't subtract 'start_address' from the first entry:
|
||||
// * If a binary is compiled w/o -pie, then the first entry in
|
||||
// process maps is likely the binary itself (all dynamic libs
|
||||
// are mapped higher in address space). For such a binary,
|
||||
// instruction offset in binary coincides with the actual
|
||||
// instruction address in virtual memory (as code section
|
||||
// is mapped to a fixed memory range).
|
||||
// * If a binary is compiled with -pie, all the modules are
|
||||
// mapped high at address space (in particular, higher than
|
||||
// shadow memory of the tool), so the module can't be the
|
||||
// first entry.
|
||||
base_address = ((num_maps == 1) ? 0U : start_address) - file_offset;
|
||||
|
||||
// Skip to file name. "cursor" now points to dev. We need to
|
||||
// skip at least two spaces for dev and inode.
|
||||
// Skip to file name. "cursor" now points to file offset. We need to
|
||||
// skip at least three spaces for file offset, dev, and inode.
|
||||
int num_spaces = 0;
|
||||
while (cursor < eol) {
|
||||
if (*cursor == ' ') {
|
||||
++num_spaces;
|
||||
} else if (num_spaces >= 2) {
|
||||
// The first non-space character after skipping two spaces
|
||||
} else if (num_spaces >= 3) {
|
||||
// The first non-space character after skipping three spaces
|
||||
// is the beginning of the file name.
|
||||
break;
|
||||
}
|
||||
@@ -616,105 +572,12 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
|
||||
// Finally, "cursor" now points to file name of our interest.
|
||||
NO_INTR(object_fd = open(cursor, O_RDONLY));
|
||||
if (object_fd < 0) {
|
||||
// Failed to open object file. Copy the object file name to
|
||||
// |out_file_name|.
|
||||
strncpy(out_file_name, cursor, out_file_name_size);
|
||||
// Making sure |out_file_name| is always null-terminated.
|
||||
out_file_name[out_file_name_size - 1] = '\0';
|
||||
return -1;
|
||||
}
|
||||
return object_fd;
|
||||
}
|
||||
}
|
||||
|
||||
// POSIX doesn't define any async-signal safe function for converting
|
||||
// an integer to ASCII. We'll have to define our own version.
|
||||
// itoa_r() converts a (signed) integer to ASCII. It returns "buf", if the
|
||||
// conversion was successful or NULL otherwise. It never writes more than "sz"
|
||||
// bytes. Output will be truncated as needed, and a NUL character is always
|
||||
// appended.
|
||||
// NOTE: code from sandbox/linux/seccomp-bpf/demo.cc.
|
||||
char *itoa_r(intptr_t i, char *buf, size_t sz, int base, size_t padding) {
|
||||
// Make sure we can write at least one NUL byte.
|
||||
size_t n = 1;
|
||||
if (n > sz)
|
||||
return NULL;
|
||||
|
||||
if (base < 2 || base > 16) {
|
||||
buf[0] = '\000';
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *start = buf;
|
||||
|
||||
uintptr_t j = i;
|
||||
|
||||
// Handle negative numbers (only for base 10).
|
||||
if (i < 0 && base == 10) {
|
||||
j = -i;
|
||||
|
||||
// Make sure we can write the '-' character.
|
||||
if (++n > sz) {
|
||||
buf[0] = '\000';
|
||||
return NULL;
|
||||
}
|
||||
*start++ = '-';
|
||||
}
|
||||
|
||||
// Loop until we have converted the entire number. Output at least one
|
||||
// character (i.e. '0').
|
||||
char *ptr = start;
|
||||
do {
|
||||
// Make sure there is still enough space left in our output buffer.
|
||||
if (++n > sz) {
|
||||
buf[0] = '\000';
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Output the next digit.
|
||||
*ptr++ = "0123456789abcdef"[j % base];
|
||||
j /= base;
|
||||
|
||||
if (padding > 0)
|
||||
padding--;
|
||||
} while (j > 0 || padding > 0);
|
||||
|
||||
// Terminate the output with a NUL character.
|
||||
*ptr = '\000';
|
||||
|
||||
// Conversion to ASCII actually resulted in the digits being in reverse
|
||||
// order. We can't easily generate them in forward order, as we can't tell
|
||||
// the number of characters needed until we are done converting.
|
||||
// So, now, we reverse the string (except for the possible "-" sign).
|
||||
while (--ptr > start) {
|
||||
char ch = *ptr;
|
||||
*ptr = *start;
|
||||
*start++ = ch;
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
// Safely appends string |source| to string |dest|. Never writes past the
|
||||
// buffer size |dest_size| and guarantees that |dest| is null-terminated.
|
||||
void SafeAppendString(const char* source, char* dest, int dest_size) {
|
||||
int dest_string_length = strlen(dest);
|
||||
SAFE_ASSERT(dest_string_length < dest_size);
|
||||
dest += dest_string_length;
|
||||
dest_size -= dest_string_length;
|
||||
strncpy(dest, source, dest_size);
|
||||
// Making sure |dest| is always null-terminated.
|
||||
dest[dest_size - 1] = '\0';
|
||||
}
|
||||
|
||||
// Converts a 64-bit value into a hex string, and safely appends it to |dest|.
|
||||
// Never writes past the buffer size |dest_size| and guarantees that |dest| is
|
||||
// null-terminated.
|
||||
void SafeAppendHexNumber(uint64_t value, char* dest, int dest_size) {
|
||||
// 64-bit numbers in hex can have up to 16 digits.
|
||||
char buf[17] = {'\0'};
|
||||
SafeAppendString(itoa_r(value, buf, sizeof(buf), 16, 0), dest, dest_size);
|
||||
}
|
||||
|
||||
// The implementation of our symbolization routine. If it
|
||||
// successfully finds the symbol containing "pc" and obtains the
|
||||
// symbol name, returns true and write the symbol name to "out".
|
||||
@@ -727,40 +590,10 @@ static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out,
|
||||
int out_size) {
|
||||
uint64_t pc0 = reinterpret_cast<uintptr_t>(pc);
|
||||
uint64_t start_address = 0;
|
||||
uint64_t base_address = 0;
|
||||
int object_fd = -1;
|
||||
|
||||
if (out_size < 1) {
|
||||
return false;
|
||||
}
|
||||
out[0] = '\0';
|
||||
SafeAppendString("(", out, out_size);
|
||||
|
||||
if (g_symbolize_open_object_file_callback) {
|
||||
object_fd = g_symbolize_open_object_file_callback(pc0, start_address,
|
||||
base_address, out + 1,
|
||||
out_size - 1);
|
||||
} else {
|
||||
object_fd = OpenObjectFileContainingPcAndGetStartAddress(pc0, start_address,
|
||||
base_address,
|
||||
out + 1,
|
||||
out_size - 1);
|
||||
}
|
||||
|
||||
// Check whether a file name was returned.
|
||||
if (object_fd < 0) {
|
||||
if (out[1]) {
|
||||
// The object file containing PC was determined successfully however the
|
||||
// object file was not opened successfully. This is still considered
|
||||
// success because the object file name and offset are known and tools
|
||||
// like asan_symbolize.py can be used for the symbolization.
|
||||
out[out_size - 1] = '\0'; // Making sure |out| is always null-terminated.
|
||||
SafeAppendString("+0x", out, out_size);
|
||||
SafeAppendHexNumber(pc0 - base_address, out, out_size);
|
||||
SafeAppendString(")", out, out_size);
|
||||
return true;
|
||||
}
|
||||
// Failed to determine the object file containing PC. Bail out.
|
||||
int object_fd = OpenObjectFileContainingPcAndGetStartAddress(pc0,
|
||||
start_address);
|
||||
if (object_fd == -1) {
|
||||
return false;
|
||||
}
|
||||
FileDescriptor wrapped_object_fd(object_fd);
|
||||
|
41
extern/libmv/third_party/glog/src/symbolize.h
vendored
41
extern/libmv/third_party/glog/src/symbolize.h
vendored
@@ -60,26 +60,9 @@
|
||||
|
||||
#ifdef HAVE_SYMBOLIZE
|
||||
|
||||
#if defined(__ELF__) // defined by gcc
|
||||
#if defined(__OpenBSD__)
|
||||
#include <sys/exec_elf.h>
|
||||
#else
|
||||
#if defined(__ELF__) // defined by gcc on Linux
|
||||
#include <elf.h>
|
||||
#endif
|
||||
|
||||
#if !defined(ANDROID)
|
||||
#include <link.h> // For ElfW() macro.
|
||||
#endif
|
||||
|
||||
// For systems where SIZEOF_VOID_P is not defined, determine it
|
||||
// based on __LP64__ (defined by gcc on 64-bit systems)
|
||||
#if !defined(SIZEOF_VOID_P)
|
||||
# if defined(__LP64__)
|
||||
# define SIZEOF_VOID_P 8
|
||||
# else
|
||||
# define SIZEOF_VOID_P 4
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// If there is no ElfW macro, let's define it by ourself.
|
||||
#ifndef ElfW
|
||||
@@ -105,10 +88,6 @@ _END_GOOGLE_NAMESPACE_
|
||||
|
||||
_START_GOOGLE_NAMESPACE_
|
||||
|
||||
// Restrictions on the callbacks that follow:
|
||||
// - The callbacks must not use heaps but only use stacks.
|
||||
// - The callbacks must be async-signal-safe.
|
||||
|
||||
// Installs a callback function, which will be called right before a symbol name
|
||||
// is printed. The callback is intended to be used for showing a file name and a
|
||||
// line number preceding a symbol name.
|
||||
@@ -120,24 +99,6 @@ typedef int (*SymbolizeCallback)(int fd, void *pc, char *out, size_t out_size,
|
||||
uint64 relocation);
|
||||
void InstallSymbolizeCallback(SymbolizeCallback callback);
|
||||
|
||||
// Installs a callback function, which will be called instead of
|
||||
// OpenObjectFileContainingPcAndGetStartAddress. The callback is expected
|
||||
// to searches for the object file (from /proc/self/maps) that contains
|
||||
// the specified pc. If found, sets |start_address| to the start address
|
||||
// of where this object file is mapped in memory, sets the module base
|
||||
// address into |base_address|, copies the object file name into
|
||||
// |out_file_name|, and attempts to open the object file. If the object
|
||||
// file is opened successfully, returns the file descriptor. Otherwise,
|
||||
// returns -1. |out_file_name_size| is the size of the file name buffer
|
||||
// (including the null-terminator).
|
||||
typedef int (*SymbolizeOpenObjectFileCallback)(uint64_t pc,
|
||||
uint64_t &start_address,
|
||||
uint64_t &base_address,
|
||||
char *out_file_name,
|
||||
int out_file_name_size);
|
||||
void InstallSymbolizeOpenObjectFileCallback(
|
||||
SymbolizeOpenObjectFileCallback callback);
|
||||
|
||||
_END_GOOGLE_NAMESPACE_
|
||||
|
||||
#endif
|
||||
|
2
extern/lzo/CMakeLists.txt
vendored
2
extern/lzo/CMakeLists.txt
vendored
@@ -23,8 +23,6 @@
|
||||
#
|
||||
# ***** END GPL LICENSE BLOCK *****
|
||||
|
||||
remove_strict_flags()
|
||||
|
||||
set(INC
|
||||
|
||||
)
|
||||
|
29
extern/sdlew/src/sdlew.c
vendored
29
extern/sdlew/src/sdlew.c
vendored
@@ -565,20 +565,16 @@ int sdlewInit(void) {
|
||||
/* Library paths. */
|
||||
#ifdef _WIN32
|
||||
/* Expected in c:/windows/system or similar, no path needed. */
|
||||
const char *paths[] = {"SDL2.dll", NULL};
|
||||
const char *path = "SDL2.dll";
|
||||
#elif defined(__APPLE__)
|
||||
/* Default installation path. */
|
||||
const char *paths[] = {"/usr/local/cuda/lib/libSDL2.dylib", NULL};
|
||||
const char *path = "/usr/local/cuda/lib/libSDL2.dylib";
|
||||
#else
|
||||
const char *paths[] = {"libSDL2.so",
|
||||
"libSDL2-2.0.so.0",
|
||||
"libSDL.so",
|
||||
NULL};
|
||||
const char *path = "libSDL2.so";
|
||||
#endif
|
||||
static int initialized = 0;
|
||||
static int result = 0;
|
||||
int a, error;
|
||||
SDL_version version;
|
||||
int error;
|
||||
|
||||
if (initialized) {
|
||||
return result;
|
||||
@@ -593,9 +589,7 @@ int sdlewInit(void) {
|
||||
}
|
||||
|
||||
/* Load library. */
|
||||
for (a = 0; paths[a] != NULL && lib == NULL; ++a) {
|
||||
lib = dynamic_library_open(paths[a]);
|
||||
}
|
||||
lib = dynamic_library_open(path);
|
||||
|
||||
if (lib == NULL) {
|
||||
result = SDLEW_ERROR_OPEN_FAILED;
|
||||
@@ -1095,18 +1089,7 @@ int sdlewInit(void) {
|
||||
SDL_LIBRARY_FIND(SDL_HasClipboardText);
|
||||
SDL_LIBRARY_FIND(SDL_GetWindowWMInfo);
|
||||
|
||||
if (SDL_GetVersion == NULL) {
|
||||
result = SDLEW_ERROR_VERSION;
|
||||
}
|
||||
else {
|
||||
SDL_GetVersion(&version);
|
||||
if(version.major < 2) {
|
||||
result = SDLEW_ERROR_VERSION;
|
||||
}
|
||||
else {
|
||||
result = SDLEW_SUCCESS;
|
||||
}
|
||||
}
|
||||
result = SDLEW_SUCCESS;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user