3636
3737# Functions
3838def check_platforms ():
39- if not is_win and not is_darwin :
40- raise SystemExit ("Error: Currently only Windows and Darwin "
39+ if not is_win and not is_darwin and not is_linux :
40+ raise SystemExit ("Error: Currently only Windows, Linux and Darwin "
4141 "platforms are supported, see Issue #135." )
4242
4343
@@ -121,7 +121,7 @@ def get_cefpython3_datas():
121121
122122 if is_win :
123123 cefdatadir = "."
124- elif is_darwin :
124+ elif is_darwin or is_linux :
125125 cefdatadir = "."
126126 else :
127127 assert False , "Unsupported system {}" .format (platform .system ())
@@ -156,7 +156,7 @@ def get_cefpython3_datas():
156156 dest_path = os .path .relpath (path , CEFPYTHON3_DIR )
157157 ret .append ((absolute_file_path , dest_path ))
158158 logger .info ("Include cefpython3 data: {}" .format (dest_path ))
159- elif is_win :
159+ elif is_win or is_linux :
160160 # The .pak files in cefpython3/locales/ directory
161161 locales_dir = os .path .join (CEFPYTHON3_DIR , "locales" )
162162 assert os .path .exists (locales_dir ), \
@@ -166,6 +166,15 @@ def get_cefpython3_datas():
166166 os .path .basename (locales_dir ), filename ))
167167 ret .append ((os .path .join (locales_dir , filename ),
168168 os .path .join (cefdatadir , "locales" )))
169+
170+ # Optional .so/.dll files in cefpython3/swiftshader/ directory
171+ swiftshader_dir = os .path .join (CEFPYTHON3_DIR , "swiftshader" )
172+ if os .path .isdir (swiftshader_dir ):
173+ for filename in os .listdir (swiftshader_dir ):
174+ logger .info ("Include cefpython3 data: {}/{}" .format (
175+ os .path .basename (swiftshader_dir ), filename ))
176+ ret .append ((os .path .join (swiftshader_dir , filename ),
177+ os .path .join (cefdatadir , "swiftshader" )))
169178 return ret
170179
171180
@@ -213,7 +222,7 @@ def get_cefpython3_datas():
213222excludedimports = get_excluded_cefpython_modules ()
214223
215224# Include binaries requiring to collect its dependencies
216- if is_darwin :
225+ if is_darwin or is_linux :
217226 binaries = [(os .path .join (CEFPYTHON3_DIR , "subprocess" ), "." )]
218227elif is_win :
219228 binaries = [(os .path .join (CEFPYTHON3_DIR , "subprocess.exe" ), "." )]
0 commit comments