in setup.py [0:0]
def build_cmake(self, ext):
cwd = os.getcwd()
# these dirs will be created in build_py, so if you don't have
# any python sources to bundle, the dirs will be missing
self.cmake_build_dir = self.build_temp + "/cmake"
create_folder_no_exception(self.cmake_build_dir)
extdir = self.get_ext_fullpath(ext.name)
create_folder_no_exception(extdir)
logger.info("will build uamqp in %s", self.cmake_build_dir)
os.chdir(cwd + "/" + self.cmake_build_dir)
generator_flags = get_generator_flags()
logger.info("Building with generator flags: {}".format(generator_flags))
build_env = get_build_env()
# Configure
configure_command = [
"cmake",
cwd + "/src/vendor/azure-uamqp-c/",
generator_flags,
"-Duse_openssl:bool={}".format("ON" if use_openssl else "OFF"),
"-Duse_default_uuid:bool=ON ", # Should we use libuuid in the system or light one?
"-Duse_builtin_httpapi:bool=ON ", # Should we use libcurl in the system or light one?
"-Dskip_samples:bool=ON", # Don't compile uAMQP samples binaries
"-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE", # ask for -fPIC
"-DCMAKE_BUILD_TYPE=Release"
]
joined_cmd = " ".join(configure_command)
logger.info("calling %s", joined_cmd)
subprocess.check_call(joined_cmd, shell=True, universal_newlines=True, env=build_env)
compile_command = ["cmake", "--build", ".", "--config", "Release"]
joined_cmd = " ".join(compile_command)
logger.info("calling %s", joined_cmd)
subprocess.check_call(joined_cmd, shell=True, universal_newlines=True, env=build_env)
os.chdir(cwd)
if USE_CYTHON:
create_cython_file()