diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index d84516161594..25f633e32546 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -46,6 +46,7 @@ foreach(filename ${MODULES}) set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_builtins.mod) endif() add_custom_command(OUTPUT ${base}.mod + COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR} COMMAND f18 -fsyntax-only ${FLANG_SOURCE_DIR}/module/${filename}.f90 WORKING_DIRECTORY ${FLANG_INTRINSIC_MODULES_DIR} DEPENDS f18 ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends}