INNER CODE UNIT · Python

basedir

mosra/magnum-integration · package/ci/make_minimal_ovr_sdk.py:44

    basedir = filename[:-4]

    # Unzip archive
    if not os.path.isdir(basedir) or not os.listdir(basedir):
        print("Extracting %s into %s" % (filename, basedir))
        os.mkdir(basedir)
        with zipfile.ZipFile(filename, 'r') as zf:
            zf.extractall(basedir)

    # Patch RuntimeLibrary property here to link the CRT dynamically like the rest of magnum instead of statically
    # See https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.vcprojectengine.runtimelibraryoption?view=visualstudiosdk-2017
    # for possible RuntimeLibrary values.
    vcProjectPath = os.path.join(basedir, "OculusSDK", "LibOVR", "Projects", "Windows", "VS2015", "LibOVR.vcxproj");
    with fileinput.FileInput(vcProjectPath, inplace=True) as file:
        for line in file:
            print(line.replace("MultiThreadedDebug<", "MultiThreadedDebugDLL<")
                      .replace("MultiThreaded<", "MultiThreadedDLL<"), # Prevent replacing substring of the above
                  end="")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…