diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-09-18 08:41:13 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-09-18 12:26:34 +0300 |
commit | 0ffd288fab5686f55d68d0d39baf59568f4389e7 (patch) | |
tree | c92e584c1a4d417f437b41cb85638ed37e4d1255 /source | |
parent | 6bf5cc62e0901175d98506216932ec6ffd4506a5 (diff) |
Build: fix gtest build flags affecting actual library
Switch to target_ functions to avoid this.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/blenlib/tests/performance/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/blentranslation/msgfmt/CMakeLists.txt | 21 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/makesdna/intern/CMakeLists.txt | 42 | ||||
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 59 | ||||
-rw-r--r-- | source/creator/CMakeLists.txt | 21 |
7 files changed, 77 insertions, 73 deletions
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index 470ffebcad4..50dc11cbf0a 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -7,6 +7,7 @@ endif() set(INC . + .. # ../blenkernel # don't add this back! ../makesdna ../../../intern/atomic diff --git a/source/blender/blenlib/tests/performance/CMakeLists.txt b/source/blender/blenlib/tests/performance/CMakeLists.txt index c4f03255a11..2e4fcd4516c 100644 --- a/source/blender/blenlib/tests/performance/CMakeLists.txt +++ b/source/blender/blenlib/tests/performance/CMakeLists.txt @@ -4,6 +4,10 @@ set(INC . .. + ../.. + ../../../makesdna + ../../../../../intern/guardedalloc + ../../../../../intern/atomic ) include_directories(${INC}) diff --git a/source/blender/blentranslation/msgfmt/CMakeLists.txt b/source/blender/blentranslation/msgfmt/CMakeLists.txt index 7b95bf210d7..dce3f0014f0 100644 --- a/source/blender/blentranslation/msgfmt/CMakeLists.txt +++ b/source/blender/blentranslation/msgfmt/CMakeLists.txt @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- # Build msgfmt executable -blender_include_dirs( +set(INC ../../../../intern/guardedalloc ../../blenlib ) @@ -13,21 +13,20 @@ set(SRC msgfmt.c ) +set(LIB + bf_blenlib + bf_intern_guardedalloc + ${ZLIB_LIBRARIES} + ${PLATFORM_LINKLIBS}) + add_cc_flags_custom_test(msgfmt) if(WIN32) string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG " /nodefaultlib:MSVCRT.lib") + list(APPEND LIB bf_intern_utfconv) endif() add_executable(msgfmt ${SRC}) setup_platform_linker_flags(msgfmt) - -target_link_libraries(msgfmt bf_blenlib) -target_link_libraries(msgfmt bf_intern_guardedalloc) - -if(WIN32) - target_link_libraries(msgfmt bf_intern_utfconv) -endif() - -target_link_libraries(msgfmt ${ZLIB_LIBRARIES}) -target_link_libraries(msgfmt ${PLATFORM_LINKLIBS}) +blender_target_include_dirs(msgfmt ${INC}) +target_link_libraries(msgfmt ${LIB}) diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt index 100266f4433..27a0cd8e55a 100644 --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@ -75,7 +75,7 @@ set(LIB ) if(WITH_PYTHON) - blender_include_dirs(../../python) + list(APPEND INC ../../python) add_definitions(-DWITH_PYTHON) endif() diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 97198117a83..0d04d7df067 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -3,6 +3,22 @@ # message(STATUS "Configuring makesdna") +set(INC + .. + ../../blenlib + ../../imbuf + ../../../../intern/atomic + ../../../../intern/guardedalloc + ${CMAKE_CURRENT_BINARY_DIR} +) + +set(INC_SYS + +) + +set(LIB +) + add_definitions(-DWITH_DNA_GHASH) # Needed for `mallocn.c`. @@ -10,14 +26,6 @@ if(HAVE_MALLOC_STATS_H) add_definitions(-DHAVE_MALLOC_STATS_H) endif() -blender_include_dirs( - ../../../../intern/atomic - ../../../../intern/guardedalloc - ../../blenlib - ../../imbuf - .. -) - set(dna_header_include_file "${CMAKE_CURRENT_BINARY_DIR}/dna_includes_all.h") set(dna_header_string_file "${CMAKE_CURRENT_BINARY_DIR}/dna_includes_as_strings.h") @@ -57,6 +65,8 @@ add_cc_flags_custom_test(makesdna) add_executable(makesdna ${SRC} ${SRC_DNA_INC}) setup_platform_linker_flags(makesdna) +blender_target_include_dirs(makesdna ${INC}) +blender_target_include_dirs_sys(makesdna ${INC_SYS}) if(WIN32 AND NOT UNIX) target_link_libraries(makesdna ${PTHREADS_LIBRARIES}) @@ -80,14 +90,6 @@ add_custom_command( # ----------------------------------------------------------------------------- # Build bf_dna library -set(INC - ${CMAKE_CURRENT_BINARY_DIR} -) - -set(INC_SYS - -) - set(SRC dna_defaults.c dna_genfile.c @@ -101,9 +103,6 @@ set(SRC dna_utils.h ) -set(LIB -) - set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h @@ -117,7 +116,10 @@ blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") # ----------------------------------------------------------------------------- # Build bf_dna_blenlib library set(INC - + ../../blenlib + ../../makesdna + ../../../../intern/atomic + ../../../../intern/guardedalloc ) set(INC_SYS diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 7e6e3bcf90e..2b06daf34e3 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -185,10 +185,33 @@ set(SRC ) set(INC - ../../../../intern/clog - - # Needed for defaults forward declarations. + . + .. + ../../blenfont + ../../blenkernel + ../../blenlib ../../blenloader + ../../blentranslation + ../../bmesh + ../../depsgraph + ../../draw + ../../gpu + ../../ikplugin + ../../imbuf + ../../makesdna + ../../modifiers + ../../nodes/ + ../../sequencer + ../../simulation + ../../windowmanager + ../../editors/include + ../../render + ../../../../intern/clog + ../../../../intern/cycles/blender + ../../../../intern/atomic + ../../../../intern/guardedalloc + ../../../../intern/memutil + ../../../../intern/mantaflow/extern ${CMAKE_BINARY_DIR}/source/blender/makesdna/intern @@ -369,38 +392,12 @@ if(WITH_GMP) endif() # Build makesrna executable -blender_include_dirs( - . - .. - ../../blenfont - ../../blenkernel - ../../blenlib - ../../blentranslation - ../../bmesh - ../../depsgraph - ../../draw - ../../gpu - ../../ikplugin - ../../imbuf - ../../makesdna - ../../modifiers - ../../nodes/ - ../../sequencer - ../../simulation - ../../windowmanager - ../../editors/include - ../../render - ../../../../intern/cycles/blender - ../../../../intern/atomic - ../../../../intern/guardedalloc - ../../../../intern/memutil - ../../../../intern/mantaflow/extern -) - add_cc_flags_custom_test(makesrna) add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC}) setup_platform_linker_flags(makesrna) +blender_target_include_dirs(makesrna ${INC}) +blender_target_include_dirs_sys(makesrna ${INC_SYS}) target_link_libraries(makesrna bf_dna) target_link_libraries(makesrna bf_dna_blenlib) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 210014c1585..05577406b48 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later # Copyright 2006 Blender Foundation. All rights reserved. -blender_include_dirs( +set(INC ../../intern/clog ../../intern/guardedalloc ../blender/blenkernel @@ -35,17 +35,17 @@ if(WITH_TBB) endif() if(WIN32) - blender_include_dirs(../../intern/utfconv) + list(APPEND INC ../../intern/utfconv) endif() if(WITH_LIBMV) - blender_include_dirs(../../intern/libmv) + list(APPEND INC ../../intern/libmv) add_definitions(-DWITH_LIBMV) endif() if(WITH_CYCLES) if(WITH_CYCLES_LOGGING) - blender_include_dirs(../../intern/cycles/blender) + list(APPEND INC ../../intern/cycles/blender) add_definitions(-DWITH_CYCLES_LOGGING) endif() endif() @@ -55,7 +55,7 @@ if(WITH_CODEC_FFMPEG) endif() if(WITH_TBB) - blender_include_dirs(${TBB_INCLUDE_DIRS}) + list(APPEND INC ${TBB_INCLUDE_DIRS}) if(WIN32) # For `pragma` that links `tbbmalloc_proxy.lib`. link_directories(${LIBDIR}/tbb/lib) @@ -64,7 +64,7 @@ endif() if(WITH_PYTHON) - blender_include_dirs(../blender/python) + list(APPEND INC ../blender/python) add_definitions(-DWITH_PYTHON) if(WITH_PYTHON_SECURITY) @@ -78,19 +78,19 @@ endif() if(WITH_SDL) if(WITH_SDL_DYNLOAD) - blender_include_dirs(../../extern/sdlew/include) + list(APPEND INC ../../extern/sdlew/include) add_definitions(-DWITH_SDL_DYNLOAD) endif() add_definitions(-DWITH_SDL) endif() if(WITH_BINRELOC) - blender_include_dirs(${BINRELOC_INCLUDE_DIRS}) + list(APPEND INC ${BINRELOC_INCLUDE_DIRS}) add_definitions(-DWITH_BINRELOC) endif() if(WITH_FREESTYLE) - blender_include_dirs(../blender/freestyle) + list(APPEND INC ../blender/freestyle) add_definitions(-DWITH_FREESTYLE) endif() @@ -99,7 +99,7 @@ if(WITH_XR_OPENXR) endif() if(WITH_GMP) - blender_include_dirs(${GMP_INCLUDE_DIRS}) + list(APPEND INC ${GMP_INCLUDE_DIRS}) add_definitions(-DWITH_GMP) endif() @@ -1285,6 +1285,7 @@ if(DEFINED PLATFORM_SYMBOLS_MAP) set_target_properties(blender PROPERTIES LINK_DEPENDS ${PLATFORM_SYMBOLS_MAP}) endif() +blender_target_include_dirs(blender ${INC}) # ----------------------------------------------------------------------------- # USD registry. |