wxwidgets/samples/webview/webview.bkl
Vadim Zeitlin 784121a07a Remove apparently accidental condition in webview sample bakefile
"target" doesn't seem to make sense nor be needed here, as removing it
doesn't change anything in the generated files.
2023-09-06 03:50:34 +02:00

131 lines
6.2 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>core</wx-lib>
<wx-lib>base</wx-lib>
<if cond="OUT_OF_TREE_MAKEFILES=='0'">
<sys-lib>$(LIB_SCINTILLA)</sys-lib>
<sys-lib>$(LIB_LEXILLA)</sys-lib>
</if>
</exe>
<wx-data id="data">
<files>
handler_advanced.html
</files>
</wx-data>
<exe id="webview_chromium_helper"
cond="FORMAT=='autoconf' and 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_WRAPPER_PATH)</lib-path>
<include>$(CEF_INCLUDE_DIR)</include>
<sys-lib>$(LIBCEF_DLL_WRAPPER_NAME)</sys-lib>
<ldflags>$(LIBCEF_LINK)</ldflags>
</if>
<add-target target="fix_cef_link" type="action"
cond="FORMAT=='autoconf' and PLATFORM_MACOSX=='1' and USE_WEBVIEW_CHROMIUM=='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/cef_helper_info.plist.in >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="FORMAT=='autoconf' and PLATFORM_MACOSX=='1' and USE_WEBVIEW_CHROMIUM=='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="FORMAT=='autoconf' and 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>-Wl,-rpath,.</ldflags>
<if cond="OUT_OF_TREE_MAKEFILES=='0' and CEF_INCLUDE_DIR!=''">
<lib-path>$(LIBCEF_WRAPPER_PATH)</lib-path>
<include>$(CEF_INCLUDE_DIR)</include>
<sys-lib>$(LIBCEF_DLL_WRAPPER_NAME)</sys-lib>
<ldflags>$(LIBCEF_LINK)</ldflags>
</if>
<win32-res>../sample.rc</win32-res>
<add-target target="package" type="action"
cond="FORMAT=='autoconf' and PLATFORM_MACOSX=='1' and USE_WEBVIEW_CHROMIUM=='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="FORMAT=='autoconf' and PLATFORM_MACOSX=='1' and USE_WEBVIEW_CHROMIUM=='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>