mr4th-dynamic-linking/clang_linking/build_win32_linking.bat

30 lines
843 B
Batchfile

@echo off
REM: Path setup
cd ..\win32_linking
SET src=%cd%
cd ..
if not exist "build\" mkdir build
cd build
REM: ### THE ARRANGEMENT OF THIS BUILD ###
REM: The "base layer" must be built and shared by all dynamic components.
REM: In this example the the base layer is linked via load-time linking with the other modules.
REM: The "plugin" is loaded at run-time.
REM: Build the base layer as a .dll (also produces load-time linking data in win32_base.lib)
clang -shared %src%\win32_base.c -o win32_base.dll
REM: Build the executable; provide the base layer's load-time linking data via win32_base.lib
clang %src%\win32_main.c win32_base.lib -o win32_main.exe
REM: Build the plugin as a .dll; provide the base layer's load-time linking data via win32_base.lib
clang -shared %src%\win32_plugin.c win32_base.lib -o win32_plugin.dll