Commit 10b4e43a authored by Martin Bauer's avatar Martin Bauer

CMake codegen interation fixes & cuda support

- proper escaping of braces when passing JSON to python
- pass information if walberla was built with CUDA to pystencils
  to support apps that use GPU optionally
parent bf85ec98
Pipeline #13924 passed with stages
in 228 minutes and 1 second
......@@ -53,15 +53,16 @@ function( handle_python_codegen sourceFilesOut generatedSourceFilesOut generator
string (REPLACE ";" "\", \"" jsonFileList "${generatedWithAbsolutePath}" )
set(pythonParameters
"{\"EXPECTED_FILES\": [\"${jsonFileList}\"], \"CMAKE_VARS\" : { "
"\\\{\"EXPECTED_FILES\": [\"${jsonFileList}\"], \"CMAKE_VARS\" : \\\{ "
"\"WALBERLA_OPTIMIZE_FOR_LOCALHOST\": \"${WALBERLA_OPTIMIZE_FOR_LOCALHOST}\","
"\"WALBERLA_DOUBLE_ACCURACY\": \"${WALBERLA_DOUBLE_ACCURACY}\","
"\"WALBERLA_BUILD_WITH_MPI\": \"${WALBERLA_BUILD_WITH_MPI}\","
"\"WALBERLA_BUILD_WITH_CUDA\": \"${WALBERLA_BUILD_WITH_CUDA}\","
"\"WALBERLA_BUILD_WITH_OPENMP\": \"${WALBERLA_BUILD_WITH_OPENMP}\" } }"
"\"WALBERLA_BUILD_WITH_OPENMP\": \"${WALBERLA_BUILD_WITH_OPENMP}\" \\\} \\\}"
)
string(REPLACE "\"" "\\\"" pythonParameters ${pythonParameters}) # even one more quoting level required
string(REPLACE "\n" "" pythonParameters ${pythonParameters}) # remove newline characters
add_custom_command(OUTPUT ${generatedWithAbsolutePath}
DEPENDS ${sourceFile}
COMMAND ${PYTHON_EXECUTABLE} ${sourceFile} ${pythonParameters}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment