diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c634903..8aa0ea65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,21 +49,6 @@ add_compile_options (-fno-strict-aliasing) include (StaticCRT) -# Avoid Posix threads. Posix threads is required for support of certain C++11 -# multi-threading features, but it introduces a new DLL dependency and we don't -# use those features. -# https://github.com/jrfonseca/drmingw/issues/82#issuecomment-1360081041 -execute_process ( - COMMAND "${CMAKE_COMMAND}" -E echo "#include \n#ifdef _GLIBCXX_HAS_GTHREADS\n#error _GLIBCXX_HAS_GTHREADS\n#endif" - COMMAND "${CMAKE_CXX_COMPILER}" -x c++ -E - - RESULT_VARIABLE STATUS_CXX11_THREADS - OUTPUT_QUIET - ERROR_QUIET -) -if (NOT STATUS_CXX11_THREADS EQUAL 0) - message (SEND_ERROR "Win32 threads required.") -endif () - # Enable stack protection # XXX: Broken on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86832 if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0" OR @@ -177,4 +162,4 @@ set (CPACK_GENERATOR "7Z") set (CPACK_STRIP_FILES ON) -include(CPack) +include(CPack) \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000..9af21d12 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,21 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "gcc64", + "generator": "Ninja", + "binaryDir": "build-gcc64", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "gcc32", + "generator": "Ninja", + "binaryDir": "build-gcc32", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ] +} \ No newline at end of file diff --git a/ci/build.ps1 b/ci/build.ps1 index 39455631..7a0a6b69 100644 --- a/ci/build.ps1 +++ b/ci/build.ps1 @@ -119,10 +119,6 @@ Exec { cmake "-S." "-B$buildDir" -G $generator "-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_ # # Build # -if ($target -eq "mingw32") { -# XXX: Temporary hack to avoid "No rule to make target lib*.dll.a" - Exec { cmake --build $buildDir --use-stderr --target libmgwhelp_implib --target libexchndl_implib } -} Exec { cmake --build $buildDir --use-stderr --target all } Exec { python tests\check_dynamic_linkage.py --objdump=objdump --validate $buildDir\bin\*.dll $buildDir\bin\*.exe } diff --git a/sample/CMakeLists.txt b/sample/CMakeLists.txt index 471579cb..54d6c008 100644 --- a/sample/CMakeLists.txt +++ b/sample/CMakeLists.txt @@ -3,8 +3,7 @@ force_debug () add_executable (sample sample.cpp ) -add_dependencies (sample exchndl_implib) -target_link_libraries (sample PRIVATE exchndl_implib) +target_link_libraries (sample PRIVATE exchndl) install (FILES sample.cpp DESTINATION sample) install (FILES sample.mak DESTINATION sample RENAME Makefile) diff --git a/src/addr2line/CMakeLists.txt b/src/addr2line/CMakeLists.txt index 05935211..36dc3c52 100644 --- a/src/addr2line/CMakeLists.txt +++ b/src/addr2line/CMakeLists.txt @@ -2,11 +2,9 @@ add_executable (addr2line addr2line.cpp ) -add_dependencies (addr2line mgwhelp_implib) - -target_link_libraries (addr2line +target_link_libraries (addr2line PRIVATE common - mgwhelp_implib + mgwhelp ) install (TARGETS addr2line RUNTIME DESTINATION bin) diff --git a/src/catchsegv/CMakeLists.txt b/src/catchsegv/CMakeLists.txt index 1f04c3d2..bac0be89 100644 --- a/src/catchsegv/CMakeLists.txt +++ b/src/catchsegv/CMakeLists.txt @@ -8,12 +8,10 @@ include_directories ( set_property (TARGET catchsegv APPEND_STRING PROPERTY LINK_FLAGS " -municode") -add_dependencies (catchsegv mgwhelp_implib) - -target_link_libraries (catchsegv +target_link_libraries (catchsegv PRIVATE common getoptW - mgwhelp_implib + mgwhelp winmm ) diff --git a/src/drmingw/CMakeLists.txt b/src/drmingw/CMakeLists.txt index 9c6f6f52..06fca183 100644 --- a/src/drmingw/CMakeLists.txt +++ b/src/drmingw/CMakeLists.txt @@ -10,11 +10,9 @@ target_compile_definitions (drmingw PRIVATE VERSION="${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" ) -add_dependencies (drmingw mgwhelp_implib) - -target_link_libraries (drmingw +target_link_libraries (drmingw PRIVATE common - mgwhelp_implib + mgwhelp ) install (TARGETS drmingw RUNTIME DESTINATION bin) diff --git a/src/exchndl/CMakeLists.txt b/src/exchndl/CMakeLists.txt index a310e367..43fd5e00 100644 --- a/src/exchndl/CMakeLists.txt +++ b/src/exchndl/CMakeLists.txt @@ -1,21 +1,7 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_C_COMPILER_ID STREQUAL GNU) - # Build import library separately, to deal with MinGW issues - - add_library (exchndl MODULE exchndl32exp.def) - - set (EXCHNDL_IMPLIB ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libexchndl.dll.a) - add_custom_command ( - OUTPUT ${EXCHNDL_IMPLIB} - COMMAND ${CMAKE_DLLTOOL} --output-lib ${EXCHNDL_IMPLIB} --dllname exchndl.dll --kill-at --input-def ${CMAKE_CURRENT_SOURCE_DIR}/exchndl32imp.def - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/exchndl32imp.def - ) - add_custom_target (libexchndl_implib DEPENDS exchndl ${EXCHNDL_IMPLIB}) - add_library (exchndl_implib INTERFACE IMPORTED GLOBAL) - target_link_libraries (exchndl_implib INTERFACE ${EXCHNDL_IMPLIB}) - install (FILES ${EXCHNDL_IMPLIB} DESTINATION lib) + add_library (exchndl SHARED exchndl32.def) else () add_library (exchndl SHARED exchndl64.def) - add_library (exchndl_implib ALIAS exchndl) endif () target_sources (exchndl PRIVATE @@ -23,11 +9,9 @@ target_sources (exchndl PRIVATE version.rc ) -add_dependencies (exchndl mgwhelp_implib) - target_link_libraries (exchndl PRIVATE common - mgwhelp_implib + mgwhelp ) set_target_properties (exchndl PROPERTIES diff --git a/src/exchndl/exchndl32.def b/src/exchndl/exchndl32.def new file mode 100644 index 00000000..94420613 --- /dev/null +++ b/src/exchndl/exchndl32.def @@ -0,0 +1,6 @@ +LIBRARY exchndl.dll + +EXPORTS + ExcHndlInit@0 == ExcHndlInit + ExcHndlSetLogFileNameA@4 == ExcHndlSetLogFileNameA + ExcHndlSetLogFileNameW@4 == ExcHndlSetLogFileNameW diff --git a/src/exchndl/exchndl32exp.def b/src/exchndl/exchndl32exp.def deleted file mode 100644 index a3e28938..00000000 --- a/src/exchndl/exchndl32exp.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY exchndl.dll - -EXPORTS - ExcHndlInit = ExcHndlInit@0 - ExcHndlSetLogFileNameA = ExcHndlSetLogFileNameA@4 - ExcHndlSetLogFileNameW = ExcHndlSetLogFileNameW@4 diff --git a/src/exchndl/exchndl32imp.def b/src/exchndl/exchndl32imp.def deleted file mode 100644 index 146f9f71..00000000 --- a/src/exchndl/exchndl32imp.def +++ /dev/null @@ -1,6 +0,0 @@ -LIBRARY exchndl.dll - -EXPORTS - ExcHndlInit@0 - ExcHndlSetLogFileNameA@4 - ExcHndlSetLogFileNameW@4 diff --git a/src/mgwhelp/CMakeLists.txt b/src/mgwhelp/CMakeLists.txt index c7541aa3..ea1702fd 100644 --- a/src/mgwhelp/CMakeLists.txt +++ b/src/mgwhelp/CMakeLists.txt @@ -1,21 +1,7 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_C_COMPILER_ID STREQUAL GNU) - # Build import library separately, to deal with MinGW issues - - add_library (mgwhelp MODULE mgwhelp32exp.def) - - set (MGWHELP_IMPLIB ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libmgwhelp.dll.a) - add_custom_command ( - OUTPUT ${MGWHELP_IMPLIB} - COMMAND ${CMAKE_DLLTOOL} --output-lib ${MGWHELP_IMPLIB} --dllname mgwhelp.dll --kill-at --input-def ${CMAKE_CURRENT_SOURCE_DIR}/mgwhelp32imp.def - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/mgwhelp32imp.def - ) - add_custom_target (libmgwhelp_implib DEPENDS mgwhelp ${MGWHELP_IMPLIB}) - add_library (mgwhelp_implib INTERFACE IMPORTED GLOBAL) - target_link_libraries (mgwhelp_implib INTERFACE ${MGWHELP_IMPLIB}) - install (FILES ${MGWHELP_IMPLIB} DESTINATION lib) + add_library (mgwhelp SHARED mgwhelp32.def) else () add_library (mgwhelp SHARED mgwhelp64.def) - add_library (mgwhelp_implib ALIAS mgwhelp) endif () target_sources (mgwhelp PRIVATE diff --git a/src/mgwhelp/mgwhelp32.def b/src/mgwhelp/mgwhelp32.def new file mode 100644 index 00000000..9e8d0a1a --- /dev/null +++ b/src/mgwhelp/mgwhelp32.def @@ -0,0 +1,108 @@ +EXPORTS + SymInitialize@12 = MgwSymInitialize@12 == SymInitialize + SymInitializeW@12 = MgwSymInitializeW@12 == SymInitializeW + SymCleanup@4 = MgwSymCleanup@4 == SymCleanup + SymSetOptions@4 = MgwSymSetOptions@4 == SymSetOptions + SymFromAddr@20 = MgwSymFromAddr@20 == SymFromAddr + SymFromAddrW@20 = MgwSymFromAddrW@20 == SymFromAddrW + SymGetLineFromAddr64@20 = MgwSymGetLineFromAddr64@20 == SymGetLineFromAddr64 + SymGetLineFromAddrW64@20 = MgwSymGetLineFromAddrW64@20 == SymGetLineFromAddrW64 + SymLoadModuleEx@36 = MgwSymLoadModuleEx@36 == SymLoadModuleEx + SymLoadModuleExW@36 = MgwSymLoadModuleExW@36 == SymLoadModuleExW + UnDecorateSymbolName@16 = MgwUnDecorateSymbolName@16 == UnDecorateSymbolName + + EnumDirTree@24 == EnumDirTree + EnumDirTreeW@24 == EnumDirTreeW + EnumerateLoadedModules@12 == EnumerateLoadedModules + EnumerateLoadedModules64@12 == EnumerateLoadedModules64 + EnumerateLoadedModulesW64@12 == EnumerateLoadedModulesW64 + ExtensionApiVersion@0 == ExtensionApiVersion + FindDebugInfoFile@12 == FindDebugInfoFile + FindDebugInfoFileEx@20 == FindDebugInfoFileEx + FindExecutableImage@12 == FindExecutableImage + FindExecutableImageEx@20 == FindExecutableImageEx + FindExecutableImageExW@20 == FindExecutableImageExW + GetTimestampForLoadedLibrary@4 == GetTimestampForLoadedLibrary + ImageDirectoryEntryToData@16 == ImageDirectoryEntryToData + ImageDirectoryEntryToDataEx@20 == ImageDirectoryEntryToDataEx + ImageNtHeader@4 == ImageNtHeader + ImageRvaToSection@12 == ImageRvaToSection + ImageRvaToVa@16 == ImageRvaToVa + ImagehlpApiVersion@0 == ImagehlpApiVersion + ImagehlpApiVersionEx@4 == ImagehlpApiVersionEx + MakeSureDirectoryPathExists@4 == MakeSureDirectoryPathExists + MapDebugInformation@16 == MapDebugInformation + MiniDumpReadDumpStream@20 == MiniDumpReadDumpStream + MiniDumpWriteDump@28 == MiniDumpWriteDump + SearchTreeForFile@12 == SearchTreeForFile + SearchTreeForFileW@12 == SearchTreeForFileW + StackWalk@36 == StackWalk + StackWalk64@36 == StackWalk64 + SymAddSymbol@32 == SymAddSymbol + SymAddSymbolW@32 == SymAddSymbolW + SymEnumLines@28 == SymEnumLines + SymEnumSourceFiles@24 == SymEnumSourceFiles + SymEnumSymbols@24 == SymEnumSymbols + SymEnumSymbolsW@24 == SymEnumSymbolsW + SymEnumTypes@20 == SymEnumTypes + SymEnumTypesW@20 == SymEnumTypesW + SymEnumerateModules@12 == SymEnumerateModules + SymEnumerateModules64@12 == SymEnumerateModules64 + SymEnumerateModulesW64@12 == SymEnumerateModulesW64 + SymEnumerateSymbols@16 == SymEnumerateSymbols + SymEnumerateSymbols64@20 == SymEnumerateSymbols64 + SymFindFileInPath@40 == SymFindFileInPath + SymFindFileInPathW@40 == SymFindFileInPathW + SymFromName@12 == SymFromName + SymFunctionTableAccess@8 == SymFunctionTableAccess + SymFunctionTableAccess64@12 == SymFunctionTableAccess64 + SymGetLineFromAddr@16 == SymGetLineFromAddr + SymGetLineNext@8 == SymGetLineNext + SymGetLineNext64@8 == SymGetLineNext64 + SymGetLinePrev@8 == SymGetLinePrev + SymGetLinePrev64@8 == SymGetLinePrev64 + SymGetModuleBase@8 == SymGetModuleBase + SymGetModuleBase64@12 == SymGetModuleBase64 + SymGetModuleInfo@12 == SymGetModuleInfo + SymGetModuleInfo64@16 == SymGetModuleInfo64 + SymGetModuleInfoW@12 == SymGetModuleInfoW + SymGetModuleInfoW64@16 == SymGetModuleInfoW64 + SymGetOptions@0 == SymGetOptions + SymGetSearchPath@12 == SymGetSearchPath + SymGetSearchPathW@12 == SymGetSearchPathW + SymGetSourceFileToken@24 == SymGetSourceFileToken + SymGetSourceFileTokenW@24 == SymGetSourceFileTokenW + SymGetSymFromAddr@16 == SymGetSymFromAddr + SymGetSymFromAddr64@20 == SymGetSymFromAddr64 + SymGetSymFromName@12 == SymGetSymFromName + SymGetSymFromName64@12 == SymGetSymFromName64 + SymGetSymNext@8 == SymGetSymNext + SymGetSymNext64@8 == SymGetSymNext64 + SymGetSymPrev@8 == SymGetSymPrev + SymGetSymPrev64@8 == SymGetSymPrev64 + SymGetTypeFromName@20 == SymGetTypeFromName + SymGetTypeInfo@24 == SymGetTypeInfo + SymLoadModule@24 == SymLoadModule + SymLoadModule64@28 == SymLoadModule64 + SymMatchFileName@16 == SymMatchFileName + SymMatchFileNameW@16 == SymMatchFileNameW + SymMatchString@12 == SymMatchString + SymRefreshModuleList@4 == SymRefreshModuleList + SymRegisterCallback@12 == SymRegisterCallback + SymRegisterCallback64@16 == SymRegisterCallback64 + SymRegisterCallbackW64@16 == SymRegisterCallbackW64 + SymRegisterFunctionEntryCallback@12 == SymRegisterFunctionEntryCallback + SymRegisterFunctionEntryCallback64@16 == SymRegisterFunctionEntryCallback64 + SymSearch@44 == SymSearch + SymSearchW@44 == SymSearchW + SymSetContext@12 == SymSetContext + SymSetParentWindow@4 == SymSetParentWindow + SymSetScopeFromAddr@12 == SymSetScopeFromAddr + SymSetSearchPath@8 == SymSetSearchPath + SymSetSearchPathW@8 == SymSetSearchPathW + SymUnDName@12 == SymUnDName + SymUnDName64@12 == SymUnDName64 + SymUnloadModule@8 == SymUnloadModule + SymUnloadModule64@12 == SymUnloadModule64 + UnmapDebugInformation@4 == UnmapDebugInformation + WinDbgExtensionDllInit@12 == WinDbgExtensionDllInit \ No newline at end of file diff --git a/src/mgwhelp/mgwhelp32exp.def b/src/mgwhelp/mgwhelp32exp.def deleted file mode 100644 index 91cee47e..00000000 --- a/src/mgwhelp/mgwhelp32exp.def +++ /dev/null @@ -1,108 +0,0 @@ -EXPORTS - SymInitialize = MgwSymInitialize@12 - SymInitializeW = MgwSymInitializeW@12 - SymCleanup = MgwSymCleanup@4 - SymSetOptions = MgwSymSetOptions@4 - SymFromAddr = MgwSymFromAddr@20 - SymFromAddrW = MgwSymFromAddrW@20 - SymGetLineFromAddr64 = MgwSymGetLineFromAddr64@20 - SymGetLineFromAddrW64 = MgwSymGetLineFromAddrW64@20 - SymLoadModuleEx = MgwSymLoadModuleEx@36 - SymLoadModuleExW = MgwSymLoadModuleExW@36 - UnDecorateSymbolName = MgwUnDecorateSymbolName@16 - - EnumDirTree = EnumDirTree@24 - EnumDirTreeW = EnumDirTreeW@24 - EnumerateLoadedModules = EnumerateLoadedModules@12 - EnumerateLoadedModules64 = EnumerateLoadedModules64@12 - EnumerateLoadedModulesW64 = EnumerateLoadedModulesW64@12 - ExtensionApiVersion = ExtensionApiVersion@0 - FindDebugInfoFile = FindDebugInfoFile@12 - FindDebugInfoFileEx = FindDebugInfoFileEx@20 - FindExecutableImage = FindExecutableImage@12 - FindExecutableImageEx = FindExecutableImageEx@20 - FindExecutableImageExW = FindExecutableImageExW@20 - GetTimestampForLoadedLibrary = GetTimestampForLoadedLibrary@4 - ImageDirectoryEntryToData = ImageDirectoryEntryToData@16 - ImageDirectoryEntryToDataEx = ImageDirectoryEntryToDataEx@20 - ImageNtHeader = ImageNtHeader@4 - ImageRvaToSection = ImageRvaToSection@12 - ImageRvaToVa = ImageRvaToVa@16 - ImagehlpApiVersion = ImagehlpApiVersion@0 - ImagehlpApiVersionEx = ImagehlpApiVersionEx@4 - MakeSureDirectoryPathExists = MakeSureDirectoryPathExists@4 - MapDebugInformation = MapDebugInformation@16 - MiniDumpReadDumpStream = MiniDumpReadDumpStream@20 - MiniDumpWriteDump = MiniDumpWriteDump@28 - SearchTreeForFile = SearchTreeForFile@12 - SearchTreeForFileW = SearchTreeForFileW@12 - StackWalk = StackWalk@36 - StackWalk64 = StackWalk64@36 - SymAddSymbol = SymAddSymbol@32 - SymAddSymbolW = SymAddSymbolW@32 - SymEnumLines = SymEnumLines@28 - SymEnumSourceFiles = SymEnumSourceFiles@24 - SymEnumSymbols = SymEnumSymbols@24 - SymEnumSymbolsW = SymEnumSymbolsW@24 - SymEnumTypes = SymEnumTypes@20 - SymEnumTypesW = SymEnumTypesW@20 - SymEnumerateModules = SymEnumerateModules@12 - SymEnumerateModules64 = SymEnumerateModules64@12 - SymEnumerateModulesW64 = SymEnumerateModulesW64@12 - SymEnumerateSymbols = SymEnumerateSymbols@16 - SymEnumerateSymbols64 = SymEnumerateSymbols64@20 - SymFindFileInPath = SymFindFileInPath@40 - SymFindFileInPathW = SymFindFileInPathW@40 - SymFromName = SymFromName@12 - SymFunctionTableAccess = SymFunctionTableAccess@8 - SymFunctionTableAccess64 = SymFunctionTableAccess64@12 - SymGetLineFromAddr = SymGetLineFromAddr@16 - SymGetLineNext = SymGetLineNext@8 - SymGetLineNext64 = SymGetLineNext64@8 - SymGetLinePrev = SymGetLinePrev@8 - SymGetLinePrev64 = SymGetLinePrev64@8 - SymGetModuleBase = SymGetModuleBase@8 - SymGetModuleBase64 = SymGetModuleBase64@12 - SymGetModuleInfo = SymGetModuleInfo@12 - SymGetModuleInfo64 = SymGetModuleInfo64@16 - SymGetModuleInfoW = SymGetModuleInfoW@12 - SymGetModuleInfoW64 = SymGetModuleInfoW64@16 - SymGetOptions = SymGetOptions@0 - SymGetSearchPath = SymGetSearchPath@12 - SymGetSearchPathW = SymGetSearchPathW@12 - SymGetSourceFileToken = SymGetSourceFileToken@24 - SymGetSourceFileTokenW = SymGetSourceFileTokenW@24 - SymGetSymFromAddr = SymGetSymFromAddr@16 - SymGetSymFromAddr64 = SymGetSymFromAddr64@20 - SymGetSymFromName = SymGetSymFromName@12 - SymGetSymFromName64 = SymGetSymFromName64@12 - SymGetSymNext = SymGetSymNext@8 - SymGetSymNext64 = SymGetSymNext64@8 - SymGetSymPrev = SymGetSymPrev@8 - SymGetSymPrev64 = SymGetSymPrev64@8 - SymGetTypeFromName = SymGetTypeFromName@20 - SymGetTypeInfo = SymGetTypeInfo@24 - SymLoadModule = SymLoadModule@24 - SymLoadModule64 = SymLoadModule64@28 - SymMatchFileName = SymMatchFileName@16 - SymMatchFileNameW = SymMatchFileNameW@16 - SymMatchString = SymMatchString@12 - SymRefreshModuleList = SymRefreshModuleList@4 - SymRegisterCallback = SymRegisterCallback@12 - SymRegisterCallback64 = SymRegisterCallback64@16 - SymRegisterCallbackW64 = SymRegisterCallbackW64@16 - SymRegisterFunctionEntryCallback = SymRegisterFunctionEntryCallback@12 - SymRegisterFunctionEntryCallback64 = SymRegisterFunctionEntryCallback64@16 - SymSearch = SymSearch@44 - SymSearchW = SymSearchW@44 - SymSetContext = SymSetContext@12 - SymSetParentWindow = SymSetParentWindow@4 - SymSetScopeFromAddr = SymSetScopeFromAddr@12 - SymSetSearchPath = SymSetSearchPath@8 - SymSetSearchPathW = SymSetSearchPathW@8 - SymUnDName = SymUnDName@12 - SymUnDName64 = SymUnDName64@12 - SymUnloadModule = SymUnloadModule@8 - SymUnloadModule64 = SymUnloadModule64@12 - UnmapDebugInformation = UnmapDebugInformation@4 - WinDbgExtensionDllInit = WinDbgExtensionDllInit@12 diff --git a/src/mgwhelp/mgwhelp32imp.def b/src/mgwhelp/mgwhelp32imp.def deleted file mode 100644 index 4e3da3d3..00000000 --- a/src/mgwhelp/mgwhelp32imp.def +++ /dev/null @@ -1,109 +0,0 @@ -LIBRARY mgwhelp.dll - -EXPORTS - EnumDirTree@24 - EnumDirTreeW@24 - EnumerateLoadedModules@12 - EnumerateLoadedModules64@12 - EnumerateLoadedModulesW64@12 - ExtensionApiVersion@0 - FindDebugInfoFile@12 - FindDebugInfoFileEx@20 - FindExecutableImage@12 - FindExecutableImageEx@20 - FindExecutableImageExW@20 - GetTimestampForLoadedLibrary@4 - ImageDirectoryEntryToData@16 - ImageDirectoryEntryToDataEx@20 - ImageNtHeader@4 - ImageRvaToSection@12 - ImageRvaToVa@16 - ImagehlpApiVersion@0 - ImagehlpApiVersionEx@4 - MakeSureDirectoryPathExists@4 - MapDebugInformation@16 - MiniDumpReadDumpStream@20 - MiniDumpWriteDump@28 - SearchTreeForFile@12 - SearchTreeForFileW@12 - StackWalk@36 - StackWalk64@36 - SymAddSymbol@32 - SymAddSymbolW@32 - SymCleanup@4 - SymEnumLines@28 - SymEnumSourceFiles@24 - SymEnumSymbols@24 - SymEnumSymbolsW@24 - SymEnumTypes@20 - SymEnumTypesW@20 - SymEnumerateModules@12 - SymEnumerateModules64@12 - SymEnumerateModulesW64@12 - SymEnumerateSymbols@16 - SymEnumerateSymbols64@20 - SymFindFileInPath@40 - SymFindFileInPathW@40 - SymFromAddr@20 - SymFromAddrW@20 - SymFromName@12 - SymFunctionTableAccess@8 - SymFunctionTableAccess64@12 - SymGetLineFromAddr@16 - SymGetLineFromAddr64@20 - SymGetLineFromAddrW64@20 - SymGetLineNext@8 - SymGetLineNext64@8 - SymGetLinePrev@8 - SymGetLinePrev64@8 - SymGetModuleBase@8 - SymGetModuleBase64@12 - SymGetModuleInfo@12 - SymGetModuleInfo64@16 - SymGetModuleInfoW@12 - SymGetModuleInfoW64@16 - SymGetOptions@0 - SymGetSearchPath@12 - SymGetSearchPathW@12 - SymGetSourceFileToken@24 - SymGetSourceFileTokenW@24 - SymGetSymFromAddr@16 - SymGetSymFromAddr64@20 - SymGetSymFromName@12 - SymGetSymFromName64@12 - SymGetSymNext@8 - SymGetSymNext64@8 - SymGetSymPrev@8 - SymGetSymPrev64@8 - SymGetTypeFromName@20 - SymGetTypeInfo@24 - SymInitialize@12 - SymInitializeW@12 - SymLoadModule@24 - SymLoadModule64@28 - SymLoadModuleEx@36 - SymLoadModuleExW@36 - SymMatchFileName@16 - SymMatchFileNameW@16 - SymMatchString@12 - SymRefreshModuleList@4 - SymRegisterCallback@12 - SymRegisterCallback64@16 - SymRegisterCallbackW64@16 - SymRegisterFunctionEntryCallback@12 - SymRegisterFunctionEntryCallback64@16 - SymSearch@44 - SymSearchW@44 - SymSetContext@12 - SymSetOptions@4 - SymSetParentWindow@4 - SymSetScopeFromAddr@12 - SymSetSearchPath@8 - SymSetSearchPathW@8 - SymUnDName@12 - SymUnDName64@12 - SymUnloadModule@8 - SymUnloadModule64@12 - UnDecorateSymbolName@16 - UnmapDebugInformation@4 - WinDbgExtensionDllInit@12 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index cf6a54a6..a770b385 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,5 @@ force_debug () - # # test_mgwhelp # @@ -8,16 +7,15 @@ force_debug () add_executable (test_mgwhelp test_mgwhelp.cpp ) -add_dependencies (test_mgwhelp mgwhelp_implib) target_link_libraries (test_mgwhelp - mgwhelp_implib + mgwhelp shlwapi ) -add_dependencies (check test_mgwhelp) add_test ( NAME test_mgwhelp COMMAND test_mgwhelp ) +set_tests_properties(test_mgwhelp PROPERTIES FIXTURES_REQUIRED test_fixture) # # test_mgwhelp_split @@ -45,11 +43,11 @@ add_custom_target (test_mgwhelp_split ALL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_split.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_split.debug ) -add_dependencies (check test_mgwhelp_split) add_test ( NAME test_mgwhelp_split COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_split.exe ) +set_tests_properties(test_mgwhelp_split PROPERTIES FIXTURES_REQUIRED test_fixture) # @@ -81,12 +79,11 @@ add_custom_target (test_mgwhelp_split_subdir ALL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_split_subdir.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/.debug/test_mgwhelp_split_subdir.debug ) -add_dependencies (check test_mgwhelp_split_subdir) add_test ( NAME test_mgwhelp_split_subdir COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_split_subdir.exe ) - +set_tests_properties(test_mgwhelp_split_subdir PROPERTIES FIXTURES_REQUIRED test_fixture) # # test_mgwhelp_stripped @@ -105,18 +102,17 @@ add_custom_target (test_mgwhelp_stripped ALL DEPENDS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_stripped.exe ) -add_dependencies (check test_mgwhelp_stripped) add_test ( NAME test_mgwhelp_stripped COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_stripped.exe ) +set_tests_properties(test_mgwhelp_stripped PROPERTIES FIXTURES_REQUIRED test_fixture) # # test_mgwhelp_zdebug # -option (ENABLE_ZDEBUG_TEST "Enable compressed debug sections test." OFF) add_custom_command ( OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_zdebug.debug COMMAND ${CMAKE_OBJCOPY} --only-keep-debug --compress-debug-sections $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_mgwhelp_zdebug.debug @@ -186,7 +182,7 @@ endif () if (OBJCOPY_VERSION STREQUAL "llvm-objcopy") set_target_properties (test_mgwhelp_zdebug PROPERTIES EXCLUDE_FROM_ALL ON) else () - add_dependencies (check test_mgwhelp_zdebug) + set_tests_properties(test_mgwhelp_zdebug PROPERTIES FIXTURES_REQUIRED test_fixture) endif () if (OBJCOPY_VERSION STREQUAL "llvm-objcopy" OR OBJCOPY_VERSION VERSION_LESS "2.34") set_tests_properties (test_mgwhelp_zdebug PROPERTIES DISABLED ON) @@ -203,14 +199,13 @@ include_directories ( add_executable (test_exchndl_static_unicode test_exchndl_static_unicode.cpp ) -add_dependencies (test_exchndl_static_unicode exchndl_implib) -target_link_libraries (test_exchndl_static_unicode exchndl_implib shlwapi) -add_dependencies (check test_exchndl_static_unicode) +target_link_libraries (test_exchndl_static_unicode exchndl shlwapi) add_test ( NAME test_exchndl_static_unicode COMMAND test_exchndl_static_unicode WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +set_tests_properties(test_exchndl_static_unicode PROPERTIES FIXTURES_REQUIRED test_fixture) # @@ -223,14 +218,13 @@ include_directories ( add_executable (test_exchndl_static_ansi test_exchndl_static_ansi.cpp ) -add_dependencies (test_exchndl_static_ansi exchndl_implib) -target_link_libraries (test_exchndl_static_ansi exchndl_implib shlwapi) -add_dependencies (check test_exchndl_static_ansi) +target_link_libraries (test_exchndl_static_ansi exchndl shlwapi) add_test ( NAME test_exchndl_static_ansi COMMAND test_exchndl_static_ansi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +set_tests_properties(test_exchndl_static_ansi PROPERTIES FIXTURES_REQUIRED test_fixture) # @@ -244,13 +238,12 @@ add_executable (test_exchndl_dynamic_unicode test_exchndl_dynamic_unicode.cpp ) target_link_libraries (test_exchndl_dynamic_unicode shlwapi) -add_dependencies (test_exchndl_dynamic_unicode exchndl) -add_dependencies (check test_exchndl_dynamic_unicode) add_test ( NAME test_exchndl_dynamic_unicode COMMAND test_exchndl_dynamic_unicode WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +set_tests_properties(test_exchndl_dynamic_unicode PROPERTIES FIXTURES_REQUIRED test_fixture) # @@ -264,13 +257,12 @@ add_executable (test_exchndl_dynamic_ansi test_exchndl_dynamic_ansi.cpp ) target_link_libraries (test_exchndl_dynamic_ansi shlwapi) -add_dependencies (test_exchndl_dynamic_ansi exchndl) -add_dependencies (check test_exchndl_dynamic_ansi) add_test ( NAME test_exchndl_dynamic_ansi COMMAND test_exchndl_dynamic_ansi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +set_tests_properties(test_exchndl_dynamic_ansi PROPERTIES FIXTURES_REQUIRED test_fixture) # @@ -280,10 +272,18 @@ add_test ( add_executable (test_addr2line test_addr2line.cpp ) -add_dependencies (test_addr2line addr2line) -add_dependencies (check test_addr2line) add_test ( NAME test_addr2line COMMAND test_addr2line WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) +set_tests_properties(test_addr2line PROPERTIES FIXTURES_REQUIRED test_fixture) + +add_test(test_build + "${CMAKE_COMMAND}" + --build "${CMAKE_BINARY_DIR}" + --config "$" + --target all +) + +set_tests_properties(test_build PROPERTIES FIXTURES_SETUP test_fixture) diff --git a/tests/apps/CMakeLists.txt b/tests/apps/CMakeLists.txt index 40f5fdba..b16f71c7 100644 --- a/tests/apps/CMakeLists.txt +++ b/tests/apps/CMakeLists.txt @@ -37,6 +37,12 @@ if (MINGW) set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer") set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer") set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer") + + add_link_options( + -static + -static-libgcc + -static-libstdc++ + ) endif () # https://github.com/jrfonseca/drmingw/issues/42