From 1b0711ebc0b93cbe822d51a1f9b6c29bd3944b2a Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 6 Apr 2021 11:51:00 -0400 Subject: [PATCH] jit_preprocess_files make sure output directory always exists --- cpp/cmake/Modules/JitifyPreprocessKernels.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/Modules/JitifyPreprocessKernels.cmake b/cpp/cmake/Modules/JitifyPreprocessKernels.cmake index 5a62fec6180..15cdabf8309 100644 --- a/cpp/cmake/Modules/JitifyPreprocessKernels.cmake +++ b/cpp/cmake/Modules/JitifyPreprocessKernels.cmake @@ -16,8 +16,6 @@ cmake_minimum_required(VERSION 3.18) -file(MAKE_DIRECTORY "${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files") - # Create `jitify_preprocess` executable project(jitify_preprocess VERSION 2.0 LANGUAGES CXX CUDA) add_executable(jitify_preprocess "${JITIFY_INCLUDE_DIR}/jitify2_preprocess.cpp") @@ -34,11 +32,13 @@ function(jit_preprocess_files) foreach(ARG_FILE ${ARG_FILES}) set(ARG_OUTPUT ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files/${ARG_FILE}.jit.hpp) + get_filename_component(jit_output_directory "${ARG_OUTPUT}" DIRECTORY ) list(APPEND JIT_PREPROCESSED_FILES "${ARG_OUTPUT}") add_custom_command(WORKING_DIRECTORY ${ARG_SOURCE_DIRECTORY} DEPENDS jitify_preprocess "${ARG_SOURCE_DIRECTORY}/${ARG_FILE}" OUTPUT ${ARG_OUTPUT} VERBATIM + COMMAND ${CMAKE_COMMAND} -E make_directory "${jit_output_directory}" COMMAND jitify_preprocess ${ARG_FILE} -o ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files -v