diff options
-rw-r--r-- | build_files/cmake/macros.cmake | 13 | ||||
-rw-r--r-- | intern/cycles/CMakeLists.txt | 9 | ||||
-rw-r--r-- | intern/cycles/SConscript | 2 | ||||
-rw-r--r-- | intern/cycles/app/CMakeLists.txt | 1 | ||||
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 3 | ||||
-rw-r--r-- | intern/cycles/kernel/osl/SConscript | 2 | ||||
-rw-r--r-- | intern/cycles/util/CMakeLists.txt | 4 | ||||
-rw-r--r-- | intern/cycles/util/util_opengl.h | 8 |
8 files changed, 34 insertions, 8 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 40bea5ed761..c031df82727 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -118,6 +118,19 @@ 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 diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 4facb8d4ff9..2ba6af48d0d 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -179,10 +179,11 @@ include_directories( ${PUGIXML_INCLUDE_DIR} ) -# TODO(sergey): Adjust so standalone repository is also happy. -include_directories( - ../atomic -) +if(CYCLES_STANDALONE_REPOSITORY) + include_directories(../third_party/atomic) +else() + include_directories(../atomic) +endif() # Warnings if(CMAKE_COMPILER_IS_GNUCXX) diff --git a/intern/cycles/SConscript b/intern/cycles/SConscript index fd7ac974ab0..9cbdb93ce85 100644 --- a/intern/cycles/SConscript +++ b/intern/cycles/SConscript @@ -65,7 +65,7 @@ if env['WITH_BF_CYCLES_DEBUG']: if env['WITH_BF_CYCLES_LOGGING']: defs.append('WITH_CYCLES_LOGGING') defs.append('GOOGLE_GLOG_DLL_DECL=') - defs.append('GFLAGS_NAMESPACE=gflags') + defs.append('CYCLES_GFLAGS_NAMESPACE=gflags') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs.append('#extern/libmv/third_party/glog/src/windows') incs.append('#extern/libmv/third_party/gflags') diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt index 6e7b650565f..f6a6f96280f 100644 --- a/intern/cycles/app/CMakeLists.txt +++ b/intern/cycles/app/CMakeLists.txt @@ -45,6 +45,7 @@ if(CYCLES_STANDALONE_REPOSITORY) endif() else() list(APPEND LIBRARIES bf_intern_glew_mx) + list(APPEND LIBRARIES extern_glog) endif() if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index d036f3e7ab9..d7c59f42a5e 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -136,5 +136,6 @@ else() set(GLOG_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/glog/src) set(GFLAGS_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/gflags) endif() - set(GFLAGS_NAMESPACE gflags) + set(GFLAGS_NAMESPACE "gflags") + set(LLVM_LIBRARIES ${LLVM_LIBRARY}) endif() diff --git a/intern/cycles/kernel/osl/SConscript b/intern/cycles/kernel/osl/SConscript index 1cb6b6a7b47..58b0204a1b9 100644 --- a/intern/cycles/kernel/osl/SConscript +++ b/intern/cycles/kernel/osl/SConscript @@ -50,7 +50,7 @@ if env['WITH_BF_CYCLES_DEBUG']: if env['WITH_BF_CYCLES_LOGGING']: defs.append('WITH_CYCLES_LOGGING') defs.append('GOOGLE_GLOG_DLL_DECL=') - defs.append('GFLAGS_NAMESPACE=gflags') + defs.append('CYCLES_GFLAGS_NAMESPACE=gflags') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs.append('#extern/libmv/third_party/glog/src/windows') incs.append('#extern/libmv/third_party/gflags') diff --git a/intern/cycles/util/CMakeLists.txt b/intern/cycles/util/CMakeLists.txt index 336e5e1711d..d52bcd6a7aa 100644 --- a/intern/cycles/util/CMakeLists.txt +++ b/intern/cycles/util/CMakeLists.txt @@ -21,6 +21,10 @@ set(SRC util_transform.cpp ) +if(NOT CYCLES_STANDALONE_REPOSITORY) + add_definitions(-DWITH_GLEW_MX) +endif() + if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI) list(APPEND SRC util_view.cpp diff --git a/intern/cycles/util/util_opengl.h b/intern/cycles/util/util_opengl.h index 2e3963612cd..0b5462e0a09 100644 --- a/intern/cycles/util/util_opengl.h +++ b/intern/cycles/util/util_opengl.h @@ -20,6 +20,12 @@ /* OpenGL header includes, used everywhere we use OpenGL, to deal with * platform differences in one central place. */ -#include "glew-mx.h" +#ifdef WITH_GLEW_MX +# include "glew-mx.h" +#else +# include <GL/glew.h> +# define mxCreateContext() glewInit() +# define mxMakeCurrentContext(x) (x) +#endif #endif /* __UTIL_OPENGL_H__ */ |