-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newBuildSystem
post master merge compile fixes & updates
#796
base: newBuildSystem
Are you sure you want to change the base?
Conversation
Signed-off-by: Ali Cheraghi <[email protected]>
3rdparty/CMakeLists.txt
Outdated
foreach(NBL_TARGET IN LISTS NBL_ALL_3RDPARTY_TARGETS) | ||
get_target_property(NBL_TARGET_SOURCE_DIR ${NBL_TARGET} SOURCE_DIR) | ||
if(${NBL_TARGET_SOURCE_DIR} MATCHES "${NBL_ROOT_PATH}/3rdparty/dxc*" OR ${NBL_TARGET_SOURCE_DIR} MATCHES "${NBL_ROOT_PATH}/3rdparty/libjpeg-turbo*") | ||
message("found:${NBL_TARGET}:${NBL_TARGET_SOURCE_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be silent check, no logs
3rdparty/CMakeLists.txt
Outdated
NBL_GET_ALL_TARGETS(NBL_ALL_3RDPARTY_TARGETS) | ||
foreach(NBL_TARGET IN LISTS NBL_ALL_3RDPARTY_TARGETS) | ||
get_target_property(NBL_TARGET_SOURCE_DIR ${NBL_TARGET} SOURCE_DIR) | ||
if(${NBL_TARGET_SOURCE_DIR} MATCHES "${NBL_ROOT_PATH}/3rdparty/dxc*" OR ${NBL_TARGET_SOURCE_DIR} MATCHES "${NBL_ROOT_PATH}/3rdparty/libjpeg-turbo*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have a NBL_3RDPARTY_IMMUTABLE_TARGET_SRC_PATTERNS
list, put "${NBL_ROOT_PATH}/3rdparty/dxc*"
and "${NBL_ROOT_PATH}/3rdparty/libjpeg-turbo*"
into the list, & use it to perform the regex pattern check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# you can move this util to common.cmake
function(NBL_MATCH_PATTERNS IN_STRING PATTERNS_VAR RESULT_VAR)
set(NBL_MATCHED FALSE)
foreach(PATTERN IN LISTS ${PATTERNS_VAR})
if(${IN_STRING} MATCHES "${PATTERN}")
set(NBL_MATCHED TRUE)
break()
endif()
endforeach()
set(${RESULT_VAR} ${NBL_MATCHED} PARENT_SCOPE)
endfunction()
set(NBL_3RDPARTY_IMMUTABLE_TARGET_SRC_PATTERNS
"${NBL_ROOT_PATH}/3rdparty/dxc*"
"${NBL_ROOT_PATH}/3rdparty/libjpeg-turbo*"
)
NBL_GET_ALL_TARGETS(NBL_ALL_3RDPARTY_TARGETS)
foreach(NBL_TARGET IN LISTS NBL_ALL_3RDPARTY_TARGETS)
get_target_property(NBL_TARGET_SOURCE_DIR ${NBL_TARGET} SOURCE_DIR)
NBL_MATCH_PATTERNS("${NBL_TARGET_SOURCE_DIR}" NBL_3RDPARTY_IMMUTABLE_TARGET_SRC_PATTERNS MATCH_FOUND)
if(MATCH_FOUND)
list(APPEND NBL_IMMUTABLE_TARGETS ${NBL_TARGET})
else()
list(APPEND NBL_MUTABLE_TARGETS ${NBL_TARGET})
endif()
endforeach()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the way why do we treat libjpeg-turbo
as immutable?
3rdparty/CMakeLists.txt
Outdated
endif() | ||
endforeach() | ||
|
||
NBL_GET_ALL_TARGETS(NBL_ALL_3RDPARTY_TARGETS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use this util second time here, at this point we don't add any new 3rdparty targets so you do the same job twice (its recursive function going through all processed CMakeLists.txt files so far inclusive down bellow your current node in the build tree), we should call it only once just before updating their properties/compile options, definitions or whatever
3rdparty/CMakeLists.txt
Outdated
set(NBL_ALL_3RDPARTY_TARGETS | ||
${NBL_ALL_3RDPARTY_TARGETS} | ||
PARENT_SCOPE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parent scope immutable & mutable target lists as well
Signed-off-by: Ali Cheraghi <[email protected]>
…king` from root `CMakeLists.txt` Co-authored-by: AnastaZIuk <[email protected]> Signed-off-by: Ali Cheraghi <[email protected]>
No description provided.