Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 7f7ddc9d258..a246a81a545 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -275,6 +275,37 @@ macro(remove_strict_flags)
endmacro()
+macro(ADD_CHECK_C_COMPILER_FLAG
+ _CFLAGS
+ _FLAG)
+
+ include(CheckCCompilerFlag)
+
+ CHECK_C_COMPILER_FLAG(${_FLAG} SUPPORT_WALL)
+
+ if(SUPPORT_WALL)
+ message(STATUS "Using CFLAG: ${_FLAG}")
+ set(_CFLAGS "${_CFLAGS} ${_FLAG}")
+ else()
+ message(STATUS "Unsupported CFLAG: ${_FLAG}")
+ endif()
+endmacro()
+
+macro(ADD_CHECK_CXX_COMPILER_FLAG
+ _CXXFLAGS
+ _FLAG)
+
+ include(CheckCXXCompilerFlag)
+
+ CHECK_CXX_COMPILER_FLAG(${_FLAG} SUPPORT_WALL)
+
+ if(SUPPORT_WALL)
+ message(STATUS "Using CXXFLAG: ${_FLAG}")
+ set(_CFLAGS "${_CXXFLAGS} ${_FLAG}")
+ else()
+ message(STATUS "Unsupported CXXFLAG: ${_FLAG}")
+ endif()
+endmacro()
macro(get_blender_version)
file(READ ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONTENT)