diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-25 20:33:55 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-25 20:33:55 +0300 |
commit | bcc020b1bc1b60f6cbd6d2c9bf400744931e57e1 (patch) | |
tree | fef4d83d0e5addb59c8389adf125281a4c7e35f8 /build_files | |
parent | 99bb1accbbb8e1ba38f30b073b22deb107bf3220 (diff) | |
parent | 3f36cd3f33e52d53d82a3a221e2a576cf26390a5 (diff) |
Merge branch 'asset-engine' into asset-experimentsasset-experiments
Conflicts:
source/blender/blenloader/intern/readfile.c
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/macros.cmake | 61 |
1 files changed, 59 insertions, 2 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index d29f086069a..f57a6952164 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -196,8 +196,33 @@ function(blender_source_group endfunction() +# Support per-target CMake flags +# Read from: CMAKE_C_FLAGS_**** (made upper case) when set. +# +# 'name' should alway match the target name, +# use this macro before add_library or add_executable. +# +# Optionally takes an arg passed to set(), eg PARENT_SCOPE. +macro(add_cc_flags_custom_test + name + ) + + string(TOUPPER ${name} _name_upper) + if(DEFINED CMAKE_C_FLAGS_${_name_upper}) + message(STATUS "Using custom CFLAGS: CMAKE_C_FLAGS_${_name_upper} in \"${CMAKE_CURRENT_SOURCE_DIR}\"") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_name_upper}}" ${ARGV1}) + endif() + if(DEFINED CMAKE_CXX_FLAGS_${_name_upper}) + message(STATUS "Using custom CXXFLAGS: CMAKE_CXX_FLAGS_${_name_upper} in \"${CMAKE_CURRENT_SOURCE_DIR}\"") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_name_upper}}" ${ARGV1}) + endif() + unset(_name_upper) + +endmacro() + + # only MSVC uses SOURCE_GROUP -function(blender_add_lib_nolist +function(blender_add_lib__impl name sources includes @@ -225,6 +250,18 @@ function(blender_add_lib_nolist endfunction() +function(blender_add_lib_nolist + name + sources + includes + includes_sys + ) + + add_cc_flags_custom_test(${name} PARENT_SCOPE) + + blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}") +endfunction() + function(blender_add_lib name sources @@ -232,7 +269,9 @@ function(blender_add_lib includes_sys ) - blender_add_lib_nolist(${name} "${sources}" "${includes}" "${includes_sys}") + add_cc_flags_custom_test(${name} PARENT_SCOPE) + + blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}") set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name}) endfunction() @@ -1508,3 +1547,21 @@ function(print_all_vars) message("${_var}=${${_var}}") endforeach() endfunction() + +macro(openmp_delayload + projectname + ) + if(MSVC) + if(WITH_OPENMP) + if(MSVC_VERSION EQUAL 1800) + set(OPENMP_DLL_NAME "vcomp120") + else() + set(OPENMP_DLL_NAME "vcomp140") + endif() + SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_RELEASE "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") + SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_DEBUG "/DELAYLOAD:${OPENMP_DLL_NAME}d.dll delayimp.lib") + SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") + SET_TARGET_PROPERTIES(${projectname} PROPERTIES LINK_FLAGS_MINSIZEREL "/DELAYLOAD:${OPENMP_DLL_NAME}.dll delayimp.lib") + endif(WITH_OPENMP) + endif(MSVC) +endmacro() |