config:编译配置。

This commit is contained in:
2025-11-25 23:59:59 +08:00
parent accf2b8123
commit 4851507a9d
2 changed files with 21 additions and 0 deletions

View File

@@ -47,6 +47,15 @@ set(MINGW_DLLS
endif() endif()
endif() endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
message(STATUS "frelay use Clang compiler.")
get_filename_component(CXX_COMPILER_PATH ${CMAKE_CXX_COMPILER} DIRECTORY)
set(LLVM_MINGW_DLL
"${CXX_COMPILER_PATH}/libc++.dll"
"${CXX_COMPILER_PATH}/libunwind.dll"
)
endif()
if(WIN32) if(WIN32)
if(DEFINED XP_PLATFORM_SUPPORT) if(DEFINED XP_PLATFORM_SUPPORT)
message(STATUS "Support Windows XP platform => ${XP_PLATFORM_SUPPORT}.") message(STATUS "Support Windows XP platform => ${XP_PLATFORM_SUPPORT}.")
@@ -112,6 +121,9 @@ install(TARGETS frelayServer DESTINATION bin)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows") if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
install(FILES ${MINGW_DLLS} DESTINATION bin) install(FILES ${MINGW_DLLS} DESTINATION bin)
endif() endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_SYSTEM_NAME MATCHES "Windows")
install(FILES ${LLVM_MINGW_DLL} DESTINATION bin)
endif()
if (WIN32) if (WIN32)
install(FILES ${QT_DEP_FILES} DESTINATION bin) install(FILES ${QT_DEP_FILES} DESTINATION bin)
safe_install_files("${QT_DEP_PLATFORM}" "bin/platforms") safe_install_files("${QT_DEP_PLATFORM}" "bin/platforms")

9
Script/qt6Clang.bat Normal file
View File

@@ -0,0 +1,9 @@
@echo on
set QT_DIR=C:/local/Qt6
cd ..
cmake -Bbuild-qt6-clang -S. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=%QT_DIR% -DQT_DEFAULT_MAJOR_VERSION=6 -DCOMPILE_GUI=ON -DRELEASE_MARK=ON
cmake --build build-qt6-clang --config Release
cd build-qt6-clang
cpack
pause