TianoCore EDK2 master
Loading...
Searching...
No Matches
UnitTestFrameworkPkgHost.dsc.inc
1## @file
2# UnitTestFrameworkPkg DSC include file for host based test DSC
3#
4# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
5# SPDX-License-Identifier: BSD-2-Clause-Patent
6#
7##
8
9!include UnitTestFrameworkPkg/UnitTestFrameworkPkgCommon.dsc.inc
10
11[LibraryClasses.common.HOST_APPLICATION]
12 BaseLib|MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
13 UnitTestHostBaseLib|MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
14 CpuLib|MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.inf
15 CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.inf
16 CmockaLib|UnitTestFrameworkPkg/Library/CmockaLib/CmockaLib.inf
17 GoogleTestLib|UnitTestFrameworkPkg/Library/GoogleTestLib/GoogleTestLib.inf
18 SubhookLib|UnitTestFrameworkPkg/Library/SubhookLib/SubhookLib.inf
19 FunctionMockLib|UnitTestFrameworkPkg/Library/FunctionMockLib/FunctionMockLib.inf
20 UnitTestLib|UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLibCmocka.inf
21 DebugLib|UnitTestFrameworkPkg/Library/Posix/DebugLibPosix/DebugLibPosix.inf
22 MemoryAllocationLib|UnitTestFrameworkPkg/Library/Posix/MemoryAllocationLibPosix/MemoryAllocationLibPosix.inf
23 UefiBootServicesTableLib|UnitTestFrameworkPkg/Library/UnitTestUefiBootServicesTableLib/UnitTestUefiBootServicesTableLib.inf
24 PeiServicesTablePointerLib|UnitTestFrameworkPkg/Library/UnitTestPeiServicesTablePointerLib/UnitTestPeiServicesTablePointerLib.inf
25 NULL|UnitTestFrameworkPkg/Library/UnitTestDebugAssertLib/UnitTestDebugAssertLibHost.inf
26 NULL|MdePkg/Library/StackCheckLibNull/StackCheckLibNullHostApplication.inf
27
28[BuildOptions]
29 MSFT:*_*_*_CC_FLAGS = /MT
30 GCC:*_*_*_CC_FLAGS = -fno-pie
31!ifdef $(UNIT_TESTING_DEBUG)
32 MSFT:*_*_*_CC_FLAGS = /MTd -D UNIT_TESTING_DEBUG=1
33 GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
34 XCODE:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
35!endif
36 GCC:*_*_*_CC_FLAGS = -fexceptions
37 GCC:*_*_*_CC_FLAGS = --coverage
38 GCC:*_*_*_DLINK_FLAGS = --coverage
39[BuildOptions.common.EDKII.HOST_APPLICATION]
40 #
41 # MSFT
42 #
43 MSFT:*_*_*_CC_FLAGS = /EHs
44 MSFT:*_*_*_DLINK_FLAGS == /out:"$(BIN_DIR)\$(MODULE_NAME_GUID).exe" /pdb:"$(BIN_DIR)\$(MODULE_NAME_GUID).pdb" /IGNORE:4001 /NOLOGO /SUBSYSTEM:CONSOLE /DEBUG /STACK:0x40000,0x40000 /WHOLEARCHIVE
45 MSFT:*_*_IA32_DLINK_FLAGS = /MACHINE:I386
46 MSFT:*_*_X64_DLINK_FLAGS = /MACHINE:AMD64
47
48 MSFT:*_VS2015_IA32_DLINK_FLAGS = /LIBPATH:"%VS2015_PREFIX%Lib" /LIBPATH:"%VS2015_PREFIX%VC\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
49 MSFT:*_VS2015x86_IA32_DLINK_FLAGS = /LIBPATH:"%VS2015_PREFIX%Lib" /LIBPATH:"%VS2015_PREFIX%VC\Lib" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
50 MSFT:*_VS2017_IA32_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
51 MSFT:*_VS2019_IA32_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
52 MSFT:*_VS2022_IA32_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
53
54 MSFT:*_VS2015_X64_DLINK_FLAGS = /LIBPATH:"%VS2015_PREFIX%VC\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
55 MSFT:*_VS2015x86_X64_DLINK_FLAGS = /LIBPATH:"%VS2015_PREFIX%VC\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
56 MSFT:*_VS2017_X64_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
57 MSFT:*_VS2019_X64_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
58 MSFT:*_VS2022_X64_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
59
60 #
61 # GCC
62 #
63 GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m32 -no-pie
64 GCC:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m64 -no-pie
65 #
66 # Surround our static libraries with whole-archive, so constructor-based test registration works properly.
67 # Note that we need to --no-whole-archive before linking system libraries.
68 #
69 GCC:*_*_*_DLINK_FLAGS = -Wl,--whole-archive
70 GCC:*_*_*_DLINK2_FLAGS == -Wl,--no-whole-archive -lgcov -lpthread -lstdc++ -lm
71
72 #
73 # Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version
74 #
75 XCODE:*_*_IA32_DLINK_PATH == gcc
76 XCODE:*_*_IA32_CC_FLAGS = -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack
77 XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon
78 XCODE:*_*_IA32_ASM_FLAGS == -arch i386 -g
79
80 XCODE:*_*_X64_DLINK_PATH == gcc
81 XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie
82 XCODE:*_*_X64_ASM_FLAGS == -g
83 XCODE:*_*_X64_CC_FLAGS = -O0 -target x86_64-apple-darwin -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=__attribute__((ms_abi))"
#define NULL
Definition: Base.h:319
#define DEBUG(Expression)
Definition: DebugLib.h:434