diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-31 23:01:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-12-31 23:31:08 +0300 |
commit | e9596e5deff93364a0fe588f8e8e408fcbcc2b96 (patch) | |
tree | 25d2a149aa9c6b77679e81337086a34a616a50b8 /build_files/cmake | |
parent | b8fc4fe5aa542064c44db3476c8d8911bf674f01 (diff) |
Cycles: Post-reintegration tweaks to ensure things do compile
This commit contains all the tweaks which were missing in initial patch
re-integration from the standalone Cycles repository.
This commit also contains an utility cmake macro to help linking targets
with different libraries for release/debug builds, the name currently is
target_link_libraries_decoupled
it gets a target and list of libraries and makes sure debug builds are
using libraries with "_d" suffix.
After all this changes it'll hopefully be easier to interchange patches
between blender and standalone repositories, because they're now quite
identical.
Diffstat (limited to 'build_files/cmake')
-rw-r--r-- | build_files/cmake/macros.cmake | 13 |
1 files changed, 13 insertions, 0 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 |