Cleanup: CMake: Modernize bf_intern_utfconv dependencies

- Remove any bf_intern_utfconv paths from INC
- Add a dependency though LIB when missing
- an empty target is created for non windows builds, so we don't have to
if(WIN32) this all over the place

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/115373
This commit is contained in:
Ray molenkamp
2023-11-28 01:11:15 +01:00
parent e67a0b9350
commit 94817f64b9
7 changed files with 13 additions and 14 deletions

View File

@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
set(INC
.
PUBLIC .
)
set(INC_SYS
@@ -19,14 +19,16 @@ set(SRC
set(LIB
)
# This is odd but leave it for now...
# Why have win32 check here? - this is only used for windows.
# ... because one day we might want to use it on other platforms.
# This library is currently windows only, for the other platforms an empty target is created this
# way we don't have to clutter if(WIN32) ... endif() all over the place to use this library.
if(WIN32)
list(APPEND SRC
utf_winfunc.cc
utf_winfunc.hh
)
blender_add_lib(bf_intern_utfconv "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
else()
add_library(bf_intern_utfconv INTERFACE)
endif()
blender_add_lib(bf_intern_utfconv "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
add_library(bf::intern::utfconv ALIAS bf_intern_utfconv)