diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-07-14 12:11:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-07-14 12:17:34 +0300 |
commit | 103a51504372129975e60f57fbf3c983527037eb (patch) | |
tree | 248f862f8df37012fabbf87582251a4882e828bf /source | |
parent | 036c006cefe471a774b837acf0325282e3ad15d0 (diff) |
CMake: per-target CFLAG & CXXFLAG support
Applying cflags globally can be problematic especially with extern, intern libs.
Now flags from target named will be used when defined,
allowing for developers to define flags for modules they maintain.
Convention is CMAKE_CFLAGS_${UPPERCASE_TARGET_NAME}, (CXXFLAGS for C++).
eg: CMAKE_CFLAGS_BF_BLENDER, CMAKE_CFLAGS_MAKESDNA, CMAKE_CXXFLAGS_CYCLES_KERNEL
On Linux run `make help` for full list of names, MSVC shows these in the solution.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/intern/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 3 | ||||
-rw-r--r-- | source/blenderplayer/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 2 |
4 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 0bb6e866bf4..8c758c33dc5 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -52,6 +52,8 @@ endif() # SRC_DNA_INC is defined in the parent dir +add_cc_flags_custom_test(makesdna) + add_executable(makesdna ${SRC} ${SRC_DNA_INC}) # Output dna.c diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 31bf0c9389b..7bfac9d0605 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -350,7 +350,10 @@ blender_include_dirs_sys( "${GLEW_INCLUDE_PATH}" ) +add_cc_flags_custom_test(makesrna) + add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) + target_link_libraries(makesrna bf_dna) target_link_libraries(makesrna bf_dna_blenlib) diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 206007b8d8b..ca841954b16 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -63,6 +63,8 @@ if(WIN32 AND NOT UNIX) COMPONENT Blenderplayer DESTINATION ".") +add_cc_flags_custom_test(blenderplayer) + elseif(APPLE) add_executable(blenderplayer ${EXETYPE} bad_level_call_stubs/stubs.c) # setup Info.plist diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 4e8dd6f9fd3..d8435284096 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -222,6 +222,8 @@ if(WITH_BUILDINFO) add_dependencies(buildinfoobj buildinfo) endif() +add_cc_flags_custom_test(blender) + # message(STATUS "Configuring blender") if(WITH_PYTHON_MODULE) add_definitions(-DWITH_PYTHON_MODULE) |