@@ -49,16 +49,7 @@ def build_extension(self, ext):
4949 extdir = os .path .abspath (os .path .dirname (self .get_ext_fullpath (ext .name )))
5050 cmake_args = [
5151 '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir ,
52- '-DPYTHON_EXECUTABLE=' + sys .executable ,
53- # For MacOS.
54- # During compiling stage, the python module always links to a temporary generated library which is going to be destroyed.
55- # Then importing the final installed module will return a link error
56- # The following commands will force the module to look up the its dynmaic linked library in the same folder
57- '-DCMAKE_INSTALL_RPATH=@loader_path' ,
58- '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON' ,
59- '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF'
60- ]
61-
52+ '-DPYTHON_EXECUTABLE=' + sys .executable ]
6253
6354 cfg = 'Debug' if self .debug else 'Release'
6455 build_args = ['--config' , cfg ]
@@ -69,11 +60,18 @@ def build_extension(self, ext):
6960 cmake_args += ['-A' , 'x64' ]
7061 build_args += ['--' , '/m' ]
7162 else :
63+ # # For MacOS.
64+ # # During compiling stage, the python module always links to a temporary generated library which is going to be destroyed.
65+ # # Then importing the final installed module will return a link error
66+ # # The following commands will force the module to look up the its dynmaic linked library in the same folder
67+ # cmake_args += [
68+ # '-DCMAKE_INSTALL_RPATH=@loader_path',
69+ # '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON',
70+ # '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF']
71+
7272 cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg ]
7373 build_args += ['--' , '-j2' ]
7474
75- print (self .build_temp )
76-
7775 env = os .environ .copy ()
7876 env ['CXXFLAGS' ] = '{} -DVERSION_INFO=\\ "{}\\ "' .format (env .get ('CXXFLAGS' , '' ), self .distribution .get_version ())
7977 if not os .path .exists (self .build_temp ):
0 commit comments