Skip to content

Commit 07e7594

Browse files
authored
Merge pull request #5769 from martin-frbg/issue5768
Fix CMake builds on Apple that use the Ninja generator
2 parents e447f2c + c1bb49d commit 07e7594

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ if (USE_OPENMP)
309309
endif()
310310

311311
# Fix "Argument list too long" for macOS - mostly seen with older OS versions on POWERPC or Intel CPUs
312-
if(APPLE)
313-
# Use response files
312+
if(APPLE AND "${CMAKE_GENERATOR}" MATCHES ".*Makefiles")
313+
# Use response files to get around the ARG_MAX limit, unless using the Ninja generator
314314
set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
315315
# Always build static library first
316316
if(BUILD_STATIC_LIBS)
@@ -333,7 +333,7 @@ if(APPLE)
333333
endif()
334334
if(NOT NOFORTRAN)
335335
set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1)
336-
set(CMAKE_Fortran_CREATE_STATIC_LIBRARY ${CREATE_STATIC_LIBRARY_COMMAND})
336+
set(CMAKE_Fortran_CREATE_STATIC_LIBRARY ${CREATE_STATIC_LIBRARY_COMMAND})
337337
if(BUILD_SHARED_LIBS)
338338
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
339339
"sh -c 'echo \"\" | ${CMAKE_Fortran_COMPILER} -o dummy.o -c -x f95-cpp-input - '"

0 commit comments

Comments
 (0)