diff --git a/scripts/genout.cmake.in b/scripts/genout.cmake.in index 3bbe453a0..01f12de2f 100644 --- a/scripts/genout.cmake.in +++ b/scripts/genout.cmake.in @@ -26,7 +26,12 @@ set(PLATFORM_C_FLAGS) if(APPLE) set(CMAKE_OSX_ARCHITECTURES "@CMAKE_OSX_ARCHITECTURES@") set(CMAKE_OSX_SYSROOT "@CMAKE_OSX_SYSROOT@") - set(PLATFORM_C_FLAGS -arch ${CMAKE_OSX_ARCHITECTURES} -isysroot ${CMAKE_OSX_SYSROOT}) + if(CMAKE_OSX_ARCHITECTURES) + set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -arch ${CMAKE_OSX_ARCHITECTURES}) + endif() + if(CMAKE_OSX_SYSROOT) + set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}) + endif() endif() get_filename_component(INPUTEXT "${INPUT}" EXT)