Skip to content

Commit

Permalink
Remove prescan (#2956)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch authored Oct 16, 2024
1 parent fd7a515 commit 9d1163d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
30 changes: 1 addition & 29 deletions cmake/API.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,6 @@ macro(restrict_platforms)
endif()
endmacro()

####
# Macro `prevent_prescan`:
#
# Prevents a CMakeLists.txt file from being processed in the prescan phase of the project. Will generate fake targets
# for all those targets specified to ensure that dependencies may be attached to these targets in the larger system.
#
# Usage:
# prevent_prescan(target1 target2 ...) # Generate fake targets and skip prescan
#
# Args:
# ARGN: list of targets to synthesize
#####
macro(prevent_prescan)
set(__CHECKER_TARGETS ${ARGN})
if (DEFINED FPRIME_PRESCAN)
foreach (__TARGET IN LISTS __CHECKER_TARGETS)
# Make prevent prescan safe in the case of multiple calls
if (NOT TARGET ${__TARGET})
add_custom_target(${__TARGET})
endif()
endforeach()
string(REPLACE ";" " " __SPACE_LIST_TARGETS "${__CHECKER_TARGETS}")
get_module_name("${CMAKE_CURRENT_LIST_DIR}")
message(STATUS "Skipping ${MODULE_NAME} during prescan, adding faux libraries: ${__SPACE_LIST_TARGETS}")
return()
endif()
endmacro()

####
# Function `add_fprime_subdirectory`:
#
Expand Down Expand Up @@ -573,7 +545,7 @@ endmacro(register_fprime_list_helper)
# **TARGET_FILE_PATH:** include path or file path file defining above functions
####
macro(register_fprime_build_autocoder TARGET_FILE_PATH TO_PREPEND)
# Normal registered targets don't run in prescan
# Normal registered targets don't run in pre-builds
if (CMAKE_DEBUG_OUTPUT)
message(STATUS "[autocoder] Registering custom build target autocoder: ${TARGET_FILE_PATH} prepend: ${TO_PREPEND}")
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/target/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function(setup_single_target TARGET_FILE MODULE SOURCES DEPENDENCIES)
cmake_language(CALL "${TARGET_NAME}_add_module_target" "${MODULE}" "${TARGET_NAME}" "${SOURCES}" "${DEPENDENCIES}")
else()
get_target_property(RECURSIVE_DEPENDENCIES "${MODULE}" FP_RECURSIVE_DEPS)
if (NOT RECURSIVE_DEPENDENCIES AND NOT DEFINED FPRIME_PRESCAN)
if (NOT RECURSIVE_DEPENDENCIES)
resolve_dependencies(RESOLVED ${DEPENDENCIES})
recurse_targets("${MODULE}" RECURSIVE_DEPENDENCIES "" ${RESOLVED})
set_target_properties("${MODULE}" PROPERTIES FP_RECURSIVE_DEPS "${RECURSIVE_DEPENDENCIES}")
Expand Down

0 comments on commit 9d1163d

Please sign in to comment.