Skip to content

Commit 9537590

Browse files
committed
Fix v56.1 build on Mac (cztomczak#335)
1 parent 1fa43af commit 9537590

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

src/client_handler/js_dialog_handler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ bool JSDialogHandler::OnJSDialog(CefRefPtr<CefBrowser> browser,
2727
dialog_type, message_text,
2828
default_prompt_text,
2929
callback, suppress_message);
30+
#if defined(OS_LINUX)
3031
if (!ret) {
3132
// Default implementation
3233
return dialog_handler_->OnJSDialog(browser, origin_url, dialog_type,
3334
message_text, default_prompt_text,
3435
callback, suppress_message);
3536
}
37+
#endif
3638
return ret;
3739
}
3840

@@ -47,20 +49,24 @@ bool JSDialogHandler::OnBeforeUnloadDialog(
4749
bool ret = JavascriptDialogHandler_OnBeforeUnloadJavascriptDialog(
4850
browser, message_text,
4951
is_reload, callback);
52+
#if defined(OS_LINUX)
5053
if (!ret) {
5154
// Default implementation
5255
return dialog_handler_->OnBeforeUnloadDialog(browser, message_text,
5356
is_reload, callback);
5457
}
58+
#endif
5559
return ret;
5660
}
5761

5862

5963
void JSDialogHandler::OnResetDialogState(CefRefPtr<CefBrowser> browser)
6064
{
6165
REQUIRE_UI_THREAD();
66+
#if defined(OS_LINUX)
6267
// Default implementation
6368
dialog_handler_->OnResetDialogState(browser);
69+
#endif
6470
// User implementation
6571
JavascriptDialogHandler_OnResetJavascriptDialogState(browser);
6672
}

src/compile_time_constants.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# This file was generated by setup.py
2-
DEF UNAME_SYSNAME = "Linux"
3-
DEF PY_MAJOR_VERSION = 2
2+
DEF UNAME_SYSNAME = "Darwin"
3+
DEF PY_MAJOR_VERSION = 3

tools/automate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def build_wrapper_library_mac():
598598
# from cefclient.
599599
cmake_wrapper = prepare_build_command(build_lib=True)
600600
cmake_wrapper.extend(["cmake", "-G", "Ninja",
601-
"-DPROJECT_ARCH=x86_64"
601+
"-DPROJECT_ARCH=x86_64",
602602
"-DCMAKE_CXX_FLAGS=-stdlib=libc++",
603603
"-DCMAKE_BUILD_TYPE=" + Options.build_type,
604604
".."])

tools/build_distrib.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
Build distribution packages for all architectures and all supported
77
python versions.
88
9-
TODO: Mac support. Currently runs only on Windows/Linux.
10-
119
Usage:
1210
build_distrib.py VERSION [--no-run-examples] [--no-rebuild]
1311
@@ -24,9 +22,11 @@
2422
1. Expects that all supported python versions are installed
2523
a) On Windows search for Pythons in the multiple default install
2624
locations
27-
b) On Mac use system Python 2.7 and Python 3 from ~/.pyenv/versions/
25+
b) On Linux use only Pythons from ~/.pyenv/versions/
2826
directory
29-
c) On Linux use only Pythons from ~/.pyenv/versions/ directory
27+
c) On Mac use Pythons from ~/.pyenv/versions/ and /usr/local/bin/python
28+
For example will use Python 2.7.13 from /usr/local/bin/ only
29+
when 2.7 was not found in ~/.pyenv/versions/.
3030
2. Expects that all python compilers for supported python versions
3131
are installed. See docs/Build-instructions.md > Requirements.
3232
3. Expects cef_binary*/ directories from Spotify Automated Builds
@@ -83,6 +83,10 @@
8383
LINUX=[
8484
"%PYENV_ROOT%/versions/*/bin",
8585
],
86+
MAC=[
87+
"%PYENV_ROOT%/versions/*/bin",
88+
"/usr/local/bin",
89+
],
8690
)
8791

8892

@@ -516,7 +520,7 @@ def test_wheel_packages(pythons):
516520
print("[build_distrib.py] Test wheel package (install, unittests) for"
517521
" {python_name}".format(python_name=python["name"]))
518522
platform_tag = get_pypi_postfix2_for_arch(python["arch"])
519-
whl_pattern = (r"*-{platform_tag}.whl"
523+
whl_pattern = (r"*{platform_tag}.whl"
520524
.format(platform_tag=platform_tag))
521525
wheels = glob.glob(os.path.join(DISTRIB_DIR, whl_pattern))
522526
assert len(wheels) == 1, ("No wheels found in distrib dir for %s"

tools/common.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,26 @@
4747

4848
# Platforms
4949
SYSTEM = platform.system().upper()
50+
if SYSTEM == "DARWIN":
51+
SYSTEM = "MAC"
5052
WINDOWS = SYSTEM if SYSTEM == "WINDOWS" else False
5153
LINUX = SYSTEM if SYSTEM == "LINUX" else False
52-
MAC = SYSTEM if SYSTEM == "DARWIN" else False
54+
MAC = SYSTEM if SYSTEM == "MAC" else False
5355

5456
OS_POSTFIX2_ARCH = dict(
5557
WINDOWS={"32bit": "win32", "64bit": "win64"},
5658
LINUX={"32bit": "linux32", "64bit": "linux64"},
57-
DARWIN={"32bit": "mac32", "64bit": "mac64"},
59+
MAC={"32bit": "mac32", "64bit": "mac64"},
5860
)
5961
CEF_POSTFIX2_ARCH = dict(
6062
WINDOWS={"32bit": "windows32", "64bit": "windows64"},
6163
LINUX={"32bit": "linux32", "64bit": "linux64"},
62-
DARWIN={"64bit": "macosx64"},
64+
MAC={"64bit": "macosx64"},
6365
)
6466
PYPI_POSTFIX2_ARCH = dict(
6567
WINDOWS={"32bit": "win32", "64bit": "win_amd64"},
6668
LINUX={"32bit": "manylinux1_i686", "64bit": "manylinux1_x86_64"},
67-
DARWIN={"64bit": "x86_64"},
69+
MAC={"64bit": "x86_64"},
6870
)
6971

7072
# Python version eg. 27

0 commit comments

Comments
 (0)