INNER CODE UNIT · Python

build_extension

patrikhuber/eos · setup.py:35

    def build_extension(self, ext):
        extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
        cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
                      '-DPYTHON_EXECUTABLE=' + sys.executable,
                      '-DEOS_BUILD_EXAMPLES=OFF',
                      '-DEOS_GENERATE_PYTHON_BINDINGS=ON'
                      ]

        cfg = 'Debug' if self.debug else 'Release'
        build_args = ['--config', cfg]

        if platform.system() == "Windows":
            if platform.architecture()[0] == '32bit':
                cmake_args += ['-A', 'Win32']
            else:
                cmake_args += ['-A', 'x64']
            cmake_args += ['-G', 'Visual Studio 17 2022']
            cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…