使用GCC / cmake生成DEF和.A文件

时间:2019-06-20 06:29:37

标签: windows gcc makefile cmake alexa

我正在尝试在此处构建Alexa SDK: https://github.com/alexa/avs-device-sdk

遵循指南并能够构建SDK和示例应用程序,但生成的库是DLL。

我需要重新构建它以输出DEF和.A文件。

查看代码,并在build.make上看到了它(显然是我第一次构建它时生成的):

# External object files for target CapabilitiesDelegate
CapabilitiesDelegate_EXTERNAL_OBJECTS =

bin/libCapabilitiesDelegate.dll: CapabilitiesDelegate/src/CMakeFiles/CapabilitiesDelegate.dir/CapabilitiesDelegate.cpp.obj
bin/libCapabilitiesDelegate.dll: CapabilitiesDelegate/src/CMakeFiles/CapabilitiesDelegate.dir/build.make
bin/libCapabilitiesDelegate.dll: ACL/src/libACL.dll.a
bin/libCapabilitiesDelegate.dll: RegistrationManager/src/libRegistrationManager.dll.a
bin/libCapabilitiesDelegate.dll: C:/msys64/mingw32/lib/libcurl.dll.a
bin/libCapabilitiesDelegate.dll: AVSCommon/libAVSCommon.dll.a
bin/libCapabilitiesDelegate.dll: C:/msys64/mingw32/lib/libcurl.dll.a
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX shared library ../../bin/libCapabilitiesDelegate.dll"
    cd /C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CapabilitiesDelegate/src && /C/msys64/mingw32/bin/cmake.exe -E remove -f CMakeFiles/CapabilitiesDelegate.dir/objects.a
    cd /C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CapabilitiesDelegate/src && /C/msys64/mingw32/bin/ar.exe cr CMakeFiles/CapabilitiesDelegate.dir/objects.a $(CapabilitiesDelegate_OBJECTS) $(CapabilitiesDelegate_EXTERNAL_OBJECTS)
    cd /C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CapabilitiesDelegate/src && /C/msys64/mingw32/bin/g++.exe  -DDEBUG -DACSDK_DEBUG_LOG_ENABLED -Wall -Werror -Wsign-compare -g -Wno-error=class-memaccess -DRAPIDJSON_HAS_STDSTRING  -shared -o ../../bin/libCapabilitiesDelegate.dll -Wl,--out-implib,libCapabilitiesDelegate.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles/CapabilitiesDelegate.dir/objects.a -Wl,--no-whole-archive ../../ACL/src/libACL.dll.a ../../RegistrationManager/src/libRegistrationManager.dll.a -lcurl ../../AVSCommon/libAVSCommon.dll.a -lcurl -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 

# Rule to build all files generated by this target.
CapabilitiesDelegate/src/CMakeFiles/CapabilitiesDelegate.dir/build: bin/libCapabilitiesDelegate.dll

在此文件的顶部,看到了以下内容:

# CMAKE generated file: DO NOT EDIT!
# Generated by "MSYS Makefiles" Generator, CMake Version 3.14

所以.. 1.关于如何生成此build.make的任何想法?我尝试在结帐上搜索,但找不到任何参考。我希望可以修改实际生成此build.make的文件以创建.a(静态)而不是.dll.a.

  1. 与此:
    cd /C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CapabilitiesDelegate/src && /C/msys64/mingw32/bin/cmake.exe -E remove -f CMakeFiles/CapabilitiesDelegate.dir/objects.a
    cd /C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CapabilitiesDelegate/src && /C/msys64/mingw32/bin/ar.exe cr CMakeFiles/CapabilitiesDelegate.dir/objects.a $(CapabilitiesDelegate_OBJECTS) $(CapabilitiesDelegate_EXTERNAL_OBJECTS)
    cd /C/Users/Thegeek/Desktop/Alexa/Alexa_32bit/build/CapabilitiesDelegate/src && /C/msys64/mingw32/bin/g++.exe  -DDEBUG -DACSDK_DEBUG_LOG_ENABLED -Wall -Werror -Wsign-compare -g -Wno-error=class-memaccess -DRAPIDJSON_HAS_STDSTRING  -shared -o ../../bin/libCapabilitiesDelegate.dll -Wl,--out-implib,libCapabilitiesDelegate.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles/CapabilitiesDelegate.dir/objects.a -Wl,--no-whole-archive ../../ACL/src/libACL.dll.a ../../RegistrationManager/src/libRegistrationManager.dll.a -lcurl ../../AVSCommon/libAVSCommon.dll.a -lcurl -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 

如何更改它以创建静态库?似乎还有其他图书馆依赖于此吗?

非常感谢您!

0 个答案:

没有答案