Cleanup: Cmake: use alias target for bf_intern_atomic

This introduces an alias target `bf::intern::atomic` for
`bf_intern_atomic`. This has the following benefits:

- Any target name with `::` in it will be recognized as an actual
target by cmake, rather than a library name it may not know about.
and will be validated by cmake to exist. Which means if you make
a typo in the LIB section, CMake will error out telling you it
doesn't know about this specific target rather than passing it on
to the build system, where you'll either get build or linker errors
because of said typo.

- Given there is quite a cleanup still to do in the build system,
it won't always be obvious which targets have been updated to
modern targets and which still need to be done. Having a namespaced
target name is a good indicator there.

Pull Request: https://projects.blender.org/blender/blender/pulls/109784
This commit is contained in:
Ray Molenkamp
2023-07-07 15:37:02 +02:00
committed by Ray molenkamp
parent 79b2e8f211
commit f0ee4c3ffe
17 changed files with 19 additions and 17 deletions

View File

@@ -10,7 +10,9 @@ set(INC_SYS
)
add_library(bf_intern_atomic INTERFACE)
target_include_directories(bf_intern_atomic INTERFACE .)
add_library(bf::intern::atomic ALIAS bf_intern_atomic)
# CMake 3.19+ allows one to populate the interface library with
# source files to show in the IDE, for people on older CMake versions