Skip to content
Snippets Groups Projects
Commit d3534a2d authored by Andreas Dedner's avatar Andreas Dedner
Browse files

Merge branch 'bugfix/dunepy-cmake-missing-source-file' into 'master'

cmake and dunepy.

See merge request !998
parents 12a95e55 f60575a2
Branches
Tags
1 merge request!998cmake and dunepy.
Pipeline #38809 passed
Pipeline: Dune Nightly Test

#38810

    ......@@ -112,15 +112,22 @@ class Builder:
    code = str(source)
    with open(os.path.join(sourceFileName), 'w') as out:
    out.write(code)
    assert os.path.isfile(sourceFileName), "Error in writing module .cc file"
    if not found:
    origPos = -1
    with open(os.path.join(self.generated_dir, "CMakeLists.txt"), 'a') as out:
    # store original file size
    origPos = out.tell()
    out.write(line+"\n")
    # update build system
    logger.debug("Rebuilding module")
    try:
    self.compile()
    except KeyboardInterrupt:
    except: # all exceptions will cause a problem here
    os.remove(os.path.join(sourceFileName))
    # remove line from CMakeLists to avoid problems
    with open(os.path.join(self.generated_dir, "CMakeLists.txt"), 'a') as out:
    out.truncate(origPos)
    raise
    elif isString(source) and not source == open(os.path.join(sourceFileName), 'r').read():
    logger.info("Compiling " + pythonName + " (updated)")
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment