wxwidgets/samples/webview/webview.bkl
Tobias Taschner ca6d2d2601
Remove additional macOS helper generation from makefiles
These additional helper bundles where only required with older CEF versions
2018-02-21 10:50:57 +01:00

127 lines
6 KiB
XML

<?xml version="1.0" ?>
<makefile>
<include file="../../build/bakefiles/common_samples.bkl"/>
<exe id="webview" template="wx_sample" template_append="wx_append">
<sources>
webview.cpp
</sources>
<headers></headers>
<wx-lib>webview</wx-lib>
<wx-lib>stc</wx-lib>
<wx-lib>adv</wx-lib>
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
<win32-res>../sample.rc</win32-res>
<if cond="OUT_OF_TREE_MAKEFILES=='0'">
<sys-lib>$(LIB_SCINTILLA)</sys-lib>
</if>
</exe>
<exe id="webview_chromium_helper" cond="PLATFORM_MACOSX=='1' and USE_WEBVIEW_CHROMIUM=='1' and FORMAT[:3] != 'msv'">
<sources>
cef_process_helper.cpp
</sources>
<if cond="OUT_OF_TREE_MAKEFILES=='0' and CEF_INCLUDE_DIR!=''">
<lib-path>$(LIBCEF_PATH)</lib-path>
<lib-path>$(LIBCEF_WRAPPER_PATH)</lib-path>
<include>$(CEF_INCLUDE_DIR)</include>
<sys-lib>$(LIBCEF_NAME)</sys-lib>
<sys-lib>$(LIBCEF_DLL_WRAPPER_NAME)</sys-lib>
<ldflags>$(LIBCEF_FRAMEWORK)</ldflags>
</if>
<add-target target="fix_cef_link" type="action"
cond="target and PLATFORM_MACOSX=='1'">
<dependency-of>all</dependency-of>
<command>
<!--make helper app bundle -->
mkdir -p webview_chromium_helper.app
mkdir -p webview_chromium_helper.app/Contents/MacOS
mkdir -p webview_chromium_helper.app/Contents/Resources
sed -e "s/\$${PRODUCT_NAME}/webview_chromium Helper/" \
-e "s/\$${EXECUTABLE_NAME}/webview_chromium Helper/" \
$(TOP_SRCDIR)/samples/webview/mac/helper-Info.plist >webview_chromium_helper.app/Contents/Info.plist
/bin/echo "APPL????" >webview_chromium_helper.app/Contents/PkgInfo
<!--Fix CEF link path -->
install_name_tool -change "@executable_path/Chromium Embedded Framework" \
"@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \
webview_chromium_helper
cp -f webview_chromium_helper webview_chromium_helper.app/Contents/MacOS/webview_chromium\ Helper
cp -f $(TOP_SRCDIR)/src/osx/carbon/wxmac.icns webview_chromium_helper.app/Contents/Resources/wxmac.icns
</command>
</add-target>
<modify-target target="clean" cond="PLATFORM_MACOSX=='1'">
<command>rm -rf $(id).app</command>
</modify-target>
</exe>
<!--
Chromium does not build with older versions of Visual Studio so don't
build the sample either.
-->
<exe id="webview_chromium" template="wx_sample" template_append="wx_append"
cond="USE_WEBVIEW_CHROMIUM=='1' and FORMAT[:3] != 'msv'">
<sources>
webview.cpp
</sources>
<define>wxWEBVIEW_SAMPLE_CHROMIUM</define>
<wx-lib>webviewchromium</wx-lib>
<wx-lib>webview</wx-lib>
<wx-lib>stc</wx-lib>
<wx-lib>adv</wx-lib>
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
<ldflags>$(LIBCEF_FRAMEWORK)</ldflags>
<ldflags>-Wl,-rpath,.</ldflags>
<if cond="OUT_OF_TREE_MAKEFILES=='0' and CEF_INCLUDE_DIR!=''">
<lib-path>$(LIBCEF_PATH)</lib-path>
<lib-path>$(LIBCEF_WRAPPER_PATH)</lib-path>
<include>$(CEF_INCLUDE_DIR)</include>
<sys-lib>$(LIBCEF_NAME)</sys-lib>
<sys-lib>$(LIBCEF_DLL_WRAPPER_NAME)</sys-lib>
</if>
<win32-res>../sample.rc</win32-res>
<add-target target="package" type="action" cond="PLATFORM_MACOSX=='1'">
<depends>webview_chromium_helper</depends>
<dependency-of>all</dependency-of>
<command>
mkdir -p webview_chromium.app/Contents/Frameworks/
mkdir -p webview_chromium.app/Contents/Frameworks/webview_chromium\ Helper.app
cp -Rf $(LIBCEF_PATH)/Chromium\ Embedded\ Framework.framework webview_chromium.app/Contents/Frameworks/
<!--Correct the CEF executable path of webview_chromium exe binary for both static/dynamic builds -->
install_name_tool -change "@executable_path/Chromium Embedded Framework" \
"@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \
webview_chromium.app/Contents/MacOS/webview_chromium
<!--Copy helper app-->
cp -Rf webview_chromium_helper.app/ webview_chromium.app/Contents/Frameworks/webview_chromium\ Helper.app/
</command>
</add-target>
<!--For dynamic builds, we need to do two extra things:
1. Copy webview_chromium library to webview_chromium.app/Contents/Frameworks/
2. correct the CEF Frameworks executable path of webview_chromium library.
-->
<add-target target="copy_and_correct_webviewchromium" type="action" cond="PLATFORM_MACOSX=='1' and SHARED=='1'">
<depends>package</depends>
<dependency-of>all</dependency-of>
<set var="webviewdll">$(DLLPREFIX)$(wxwin.mkDllName("webview")).dylib</set>
<set var="webviewchromiumdll">$(DLLPREFIX)$(wxwin.mkDllName("webviewchromium")).dylib</set>
<command>
cp $(wx_top_builddir)/lib/$(webviewdll) webview_chromium.app/Contents/Frameworks/
cp $(wx_top_builddir)/lib/$(webviewchromiumdll) webview_chromium.app/Contents/Frameworks/
install_name_tool -change "@executable_path/Chromium Embedded Framework" \
"@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" \
$(wx_top_builddir)/lib/$(webviewchromiumdll)
</command>
</add-target>>
<if cond="OUT_OF_TREE_MAKEFILES=='0'">
<sys-lib>$(LIB_SCINTILLA)</sys-lib>
</if>
</exe>
</makefile>