From 4b51da0ae181ded262ff7609bd0baac67a4e92ba Mon Sep 17 00:00:00 2001 From: Alexey Gavrilov Date: Fri, 3 Jul 2026 11:52:41 +0700 Subject: File write functions changes In `outFeaturesToFile` function toolset is appends to a resulting file (cmake toolchain file or arch, compiler if previous is not specify). Toolset mention needs to filter available features for a specific platform. FEATURE__IS_ENABLING var also provides when already enabled. Build type is not in toolset now. That means to parse `CMAKE_BUILD_TYPE` anyway when toolset is processing even if `CMAKE_TOOLSCHAIN_FILE` is specified. Signed-off-by: Alexey Gavrilov --- cmake/module/runfile.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cmake/module/runfile.cmake') diff --git a/cmake/module/runfile.cmake b/cmake/module/runfile.cmake index af196aa..f9d1640 100644 --- a/cmake/module/runfile.cmake +++ b/cmake/module/runfile.cmake @@ -24,25 +24,25 @@ macro(parseFeatures vars outfile) endmacro() macro(parseToolset vars outfile) + convertCacheVarIntoArg(CMAKE_BUILD_TYPE ${vars} ${outfile}) if("CMAKE_TOOLCHAIN_FILE" IN_LIST ${vars} AND NOT ${CMAKE_TOOLCHAIN_FILE}) cmake_path(GET CMAKE_TOOLCHAIN_FILE FILENAME TOOLCHAIN_FILE_NAME) file(APPEND ${${outfile}} " -DCMAKE_TOOLCHAIN_FILE=" "${ObjectiveProject_SOURCE_DIR}/cmake/toolchain/${TOOLCHAIN_FILE_NAME}") else() - # If toolchain file isn't specifies, there are three things to pass - # in cmake: architecture, c++ compiler and build type + # If toolchain file isn't specifies, there are two things to pass + # in cmake: architecture and c++ compiler convertCacheVarIntoArg(ObjectiveProject_ARCHITECTURE ${vars} ${outfile}) cmake_path(GET CMAKE_CXX_COMPILER FILENAME COMPILER_EXECUTABLE) if(NOT "${COMPILER_EXECUTABLE}" STREQUAL "") file(APPEND ${${outfile}} " -DCMAKE_CXX_COMPILER=${COMPILER_EXECUTABLE}") endif() - convertCacheVarIntoArg(CMAKE_BUILD_TYPE ${vars} ${outfile}) endif() endmacro() -function(confwrite) +function(writerunfile) set(OUT_FILE "${CMAKE_BINARY_DIR}/${CONFFILE_NAME}") get_directory_property(cacheVars CACHE_VARIABLES) -- cgit v1.2.3