Skip to content

Commit

Permalink
Fixing Two Minor CMake Bugs (#2412)
Browse files Browse the repository at this point in the history
* Fixing improper unsetting of CMake variables

* Fixing improper user of CMAKE_SYSTEM_NAME
  • Loading branch information
LeStarch authored Dec 7, 2023
1 parent 651fb4e commit 2604f85
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmake/API.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ set(FPRIME_AUTOCODER_TARGET_LIST "" CACHE INTERNAL "FPRIME_AUTOCODER_TARGET_LIST
#####
macro(restrict_platforms)
set(__CHECKER ${ARGN})
if (NOT FPRIME_TOOLCHAIN_NAME IN_LIST __CHECKER AND NOT CMAKE_SYSTEM_NAME IN_LIST __CHECKER)
if (NOT FPRIME_TOOLCHAIN_NAME IN_LIST __CHECKER AND NOT FPRIME_PLATFORM IN_LIST __CHECKER)
get_module_name("${CMAKE_CURRENT_LIST_DIR}")
message(STATUS "Neither toolchain ${FPRIME_TOOLCHAIN_NAME} nor platform ${CMAKE_SYSTEM_NAME} supported for module ${MODULE_NAME}")
message(STATUS "Neither toolchain ${FPRIME_TOOLCHAIN_NAME} nor platform ${FPRIME_PLATFORM} supported for module ${MODULE_NAME}")
return()
endif()
endmacro()
Expand Down Expand Up @@ -98,8 +98,9 @@ function(add_fprime_subdirectory FP_SOURCE_DIR)
set(FPRIME_CURRENT_MODULE "${MODULE_NAME}")

# Unset all variables that carry special meaning as it is dangerous to pass them through
init_variables(SOURCE_FILES MOD_DEPS UT_SOURCE_FILES UT_MOD_DEPS EXECUTABLE_NAME)

foreach (VARIABLE IN ITEMS SOURCE_FILES MOD_DEPS UT_SOURCE_FILES UT_MOD_DEPS EXECUTABLE_NAME)
set(${VARIABLE} PARENT_SCOPE)
endforeach()

# Check if the binary and source directory are in agreement. If they agree, then normally add
# the directory, as no adjustments need be made.
Expand Down

0 comments on commit 2604f85

Please sign in to comment.