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/UnitTestFrameworkPkgTarget.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 |
|
---|
27 | [BuildOptions]
|
---|
28 | MSFT:*_*_*_CC_FLAGS = /MT
|
---|
29 | GCC:*_*_*_CC_FLAGS = -fno-pie
|
---|
30 | !ifdef $(UNIT_TESTING_DEBUG)
|
---|
31 | MSFT:*_*_*_CC_FLAGS = /MTd -D UNIT_TESTING_DEBUG=1
|
---|
32 | GCC:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
|
---|
33 | XCODE:*_*_*_CC_FLAGS = -D UNIT_TESTING_DEBUG=1
|
---|
34 | !endif
|
---|
35 | GCC:*_*_*_CC_FLAGS = -fexceptions
|
---|
36 | GCC:*_*_*_CC_FLAGS = --coverage
|
---|
37 | GCC:*_*_*_DLINK_FLAGS = --coverage
|
---|
38 | [BuildOptions.common.EDKII.HOST_APPLICATION]
|
---|
39 | #
|
---|
40 | # MSFT
|
---|
41 | #
|
---|
42 | MSFT:*_*_*_CC_FLAGS = /EHs
|
---|
43 | 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
|
---|
44 | MSFT:*_*_IA32_DLINK_FLAGS = /MACHINE:I386
|
---|
45 | MSFT:*_*_X64_DLINK_FLAGS = /MACHINE:AMD64
|
---|
46 |
|
---|
47 | 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"
|
---|
48 | 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"
|
---|
49 | MSFT:*_VS2017_IA32_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
|
---|
50 | MSFT:*_VS2019_IA32_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x86" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x86" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x86"
|
---|
51 |
|
---|
52 | MSFT:*_VS2015_X64_DLINK_FLAGS = /LIBPATH:"%VS2015_PREFIX%VC\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
|
---|
53 | MSFT:*_VS2015x86_X64_DLINK_FLAGS = /LIBPATH:"%VS2015_PREFIX%VC\Lib\AMD64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
|
---|
54 | MSFT:*_VS2017_X64_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
|
---|
55 | MSFT:*_VS2019_X64_DLINK_FLAGS = /LIBPATH:"%VCToolsInstallDir%lib\x64" /LIBPATH:"%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64" /LIBPATH:"%WindowsSdkDir%lib\%WindowsSDKLibVersion%\um\x64"
|
---|
56 |
|
---|
57 | #
|
---|
58 | # GCC
|
---|
59 | #
|
---|
60 | GCC:*_*_IA32_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m32 -no-pie
|
---|
61 | GCC:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -m64 -no-pie
|
---|
62 | #
|
---|
63 | # Surround our static libraries with whole-archive, so constructor-based test registration works properly.
|
---|
64 | # Note that we need to --no-whole-archive before linking system libraries.
|
---|
65 | #
|
---|
66 | GCC:*_*_*_DLINK_FLAGS = -Wl,--whole-archive
|
---|
67 | GCC:*_*_*_DLINK2_FLAGS == -Wl,--no-whole-archive -lgcov -lpthread -lstdc++ -lm
|
---|
68 |
|
---|
69 | #
|
---|
70 | # Need to do this link via gcc and not ld as the pathing to libraries changes from OS version to OS version
|
---|
71 | #
|
---|
72 | XCODE:*_*_IA32_DLINK_PATH == gcc
|
---|
73 | XCODE:*_*_IA32_CC_FLAGS = -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack
|
---|
74 | XCODE:*_*_IA32_DLINK_FLAGS == -arch i386 -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon
|
---|
75 | XCODE:*_*_IA32_ASM_FLAGS == -arch i386 -g
|
---|
76 |
|
---|
77 | XCODE:*_*_X64_DLINK_PATH == gcc
|
---|
78 | XCODE:*_*_X64_DLINK_FLAGS == -o $(BIN_DIR)/$(MODULE_NAME_GUID) -L/usr/X11R6/lib -lXext -lX11 -framework Carbon -Wl,-no_pie
|
---|
79 | XCODE:*_*_X64_ASM_FLAGS == -g
|
---|
80 | XCODE:*_*_X64_CC_FLAGS = -O0 -target x86_64-apple-darwin -I$(WORKSPACE)/EmulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=__attribute__((ms_abi))"
|
---|