simbit18 commented on PR #14892:
URL: https://github.com/apache/nuttx/pull/14892#issuecomment-2493788392

   > Thanks for fixing this! (I wonder if there's a command line length limit 
on Unix?)
   
   @hartmannathan try this with cmake
   
   ```
   cmake_minimum_required(VERSION 3.16)
   
   project(ManySources C)
   set(srcs "")
   # Increase MAX_SRC_FILE_INDEX value as needed
   set(MAX_SRC_FILE_INDEX 5000)
   set(TEST_SRC_FILE_BASE_NAME 
"this_is_a_test_src_file_with_a_quite_lengthy_name_to_simulate_very_long_command_line_length_problems_on_host_")
   foreach(i RANGE 1 ${MAX_SRC_FILE_INDEX})
     set(src "${CMAKE_CURRENT_BINARY_DIR}/src/${TEST_SRC_FILE_BASE_NAME}${i}.c")
     file(WRITE "${src}" "int s${i}(void) { return 0; }\n")
     list(APPEND srcs ${src})
   endforeach()
   
   add_library(foo ${srcs})
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to