ソースを参照

#IQRV #comment CMake优化

80374374 1 年間 前
コミット
a706e5e7dc
4 ファイル変更35 行追加75 行削除
  1. 6 0
      CMakeLists.txt
  2. 0 63
      CMakePresets.json
  3. 3 2
      DevAdapter/CMakeLists.txt
  4. 26 10
      addin/cmake/DependencyConanFiles.cmake

+ 6 - 0
CMakeLists.txt

@@ -284,9 +284,15 @@ if(CONAN_CACHE_CLEAR)
 	conan_local_remove()
 endif(CONAN_CACHE_CLEAR)
 
+if(MSVC)
+conan_cmake_run(REQUIRES RvcFramework/1.10.0@LR04.02_FrameworkLib/testing
+	Audio/2023.0509.01@LR04.02_MediaRes/testing
+BASIC_SETUP CMAKE_TARGETS)
+else()
 conan_cmake_run(REQUIRES RvcFramework/1.2.0.22@LR04.02_FrameworkLib/dev
 	Audio/2023.0509.01@LR04.02_MediaRes/testing
 BASIC_SETUP CMAKE_TARGETS)
+endif(MSVC)
 include(DependencyConanFiles)
 
 set(RVC_CONAN_DEP_LIBS ${CONAN_BIN_DIRS})

+ 0 - 63
CMakePresets.json

@@ -1,63 +0,0 @@
-{
-  "version": 2,
-  "configurePresets": [
-    {
-      "name": "linux-default",
-      "displayName": "Linux Debug",
-      "description": "面向适用于 Linux 的 Windows 子系统(WSL)或远程 Linux 系统。",
-      "generator": "Unix Makefiles",
-      "binaryDir": "${sourceDir}/out/build/${presetName}",
-      "cacheVariables": {
-        "CMAKE_BUILD_TYPE": "Debug",
-        "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
-        "SIMULATE_ON": {
-          "value": "False",
-          "type": "BOOL"
-        },
-        "BUILD_TESTING": "OFF",
-        "BUILD_DEVADAPTER": "ON"
-      },
-      "vendor": {
-        "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
-        "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
-      }
-    },
-    {
-      "name": "linux-release",
-      "displayName": "Linux Release",
-      "description": "面向适用于 Linux 的 Windows 子系统(WSL)或远程 Linux 系统。",
-      "generator": "Unix Makefiles",
-      "binaryDir": "${sourceDir}/out/build/${presetName}",
-      "cacheVariables": {
-        "CMAKE_BUILD_TYPE": "Release",
-        "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
-        "SIMULATE_ON": {
-          "value": "False",
-          "type": "BOOL"
-        },
-        "BUILD_TESTING": "OFF",
-        "BUILD_DEVADAPTER": "ON"
-      },
-      "vendor": {
-        "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Linux" ] },
-        "microsoft.com/VisualStudioRemoteSettings/CMake/1.0": { "sourceDir": "$env{HOME}/.vs/$ms{projectDirName}" }
-      }
-    },
-    {
-      "name": "windows-default",
-      "displayName": "Windows x64 Debug",
-      "description": "面向具有 Visual Studio 开发环境的 Windows。",
-      "generator": "Visual Studio 16 2019",
-      "binaryDir": "${sourceDir}/out/build/${presetName}",
-      "architecture": {
-        "value": "x64",
-        "strategy": "external"
-      },
-      "cacheVariables": {
-        "CMAKE_BUILD_TYPE": "Debug",
-        "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}"
-      },
-      "vendor": { "microsoft.com/VisualStudioSettings/CMake/1.0": { "hostOS": [ "Windows" ] } }
-    }
-  ]
-}

+ 3 - 2
DevAdapter/CMakeLists.txt

@@ -243,6 +243,7 @@ message(STATUS "vendor log library: ${VENDOR_LOG_LIB_NAME}")
 
 # 通过conan的方式管理厂商库
 if(DEVADAPTER_USING_CONAN)
+if(NOT MSVC)
     set(KEBA_CONAN_LIB_NAME keba/2023.0524.01@LR04.02_VendorLib/testing)
 	set(GRG_CONAN_LIB_NAME grg/2023.0526.01@LR04.02_VendorLib/testing)
 	set(CW_CONAN_LIB_NAME cw/2021.0927.01@LR04.02_VendorLib/testing)
@@ -251,7 +252,7 @@ if(DEVADAPTER_USING_CONAN)
         set(KEBA_CONAN_ALL_LIB_NAME keba/2023.0606.39@LR04.02_VendorLib/stable)
         rvc_aggerate_vendor_libs(keba)
     endif(RVC_INTEGRATE_BUILDV2)
-
+endif(NOT MSVC)
 endif(DEVADAPTER_USING_CONAN)
  
 file(GLOB all_valid_subdirs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/CMakeLists.txt")
@@ -293,7 +294,7 @@ if(RVC_INTEGRATE_BUILD)
     endforeach()
 
 elseif(RVC_VENDOR_CONFIGV2)
-    # 此列表中的文件已在终端应用中包含,所以要移除
+    # 此列表中的文件已在终端应用中包含,所以要移除,TODO: Windows 需要兼容
     set(USELESS_DEVADAPTER_FILE_NAMES
     liblog4cplus.so
     libcmblog4vendor.so

+ 26 - 10
addin/cmake/DependencyConanFiles.cmake

@@ -1,11 +1,12 @@
 
+#conan create . LR04.02_ThirdParty/stable -s arch=x86 -s os=Windows -s compiler="Visual Studio" -s compiler.version=16  -s build_type=Release
+#conan create . LR04.02_ThirdParty/stable -s arch=x86 -s os=Windows -s compiler="Visual Studio" -s compiler.version=16  -s build_type=Debug
+
+#conan create . LR04.02_ThirdParty/stable -s arch=armv8 -s os=Linux -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=8 -s build_type=Release
+#conan create . LR04.02_ThirdParty/stable -s arch=armv8 -s os=Linux -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=8 -s build_type=Debug
+#conan upload log4cplus/1.2.1@LR04.02_ThirdParty/stable --all -r=conan-cmb
+
 set(CONAN_ALLPLATFORM_LIB_NAMES
-	#mod_download mod_evtconverter mod_ThermalPrint
-	expat/2.1.0@LR04.02_ThirdParty/testing
-	#mod_ThermalPrint mod_evtconverter mod_download
-	scew/1.1.7@LR04.02_ThirdParty/testing
-	#mod_snapshot mod_screenshot mod_RomoteController mod_UpgradeRun mod_upload libscreencodec 
-	zlib/1.2.11@LR04.02_ThirdParty/stable
 	#libbizchan mod_screenshot mod_snapshot
 	openjpeg/2.0.0@LR04.02_ThirdParty/testing
 
@@ -25,12 +26,17 @@ set(CONAN_ALLPLATFORM_LIB_NAMES
 	#cefclient_mutable/3.0@LR04.02_ThirdParty/testing
 	#mod_chromium mod_RomoteController mod_rpc
 	boost/1.69.0@LR04.02_ThirdParty/testing
-	#liblog4vendor
-	log4cplus/1.2.1@LR04.02_ThirdParty/slim # !!!!support build missing!!!!
+
 )
 
 if(MSVC)
 	set(CONAN_CURPLATFORM_LIB_NAMES
+			#mod_snapshot mod_screenshot mod_RomoteController mod_UpgradeRun mod_upload libscreencodec 
+			#zlib/1.2.11@LR04.02_ThirdParty/vcpkg
+			#mod_download mod_evtconverter mod_ThermalPrint
+			expat/2.1.0@LR04.02_ThirdParty/stable
+			#mod_ThermalPrint mod_evtconverter mod_download
+			scew/1.1.7@LR04.02_ThirdParty/stable
 			#mod_snapshot mod_mediacontroller mod_sipphone libvideoqueue
 			IPP/1.0@LR04.02_ThirdParty/testing
 			#mod_mediacontroller libaudioframwork showdev mod_sipphone
@@ -48,9 +54,18 @@ if(MSVC)
 			#mod_sipphone
 			sofia/1.12.11@LR04.02_ThirdParty/testing
 			 #mod_sipphone mod_mediacontroller showdev MediaDevDetect libaudioframwork
-			portaudio/v190600.20161030@LR04.02_ThirdParty/testing)
+			portaudio/v190600.20161030@LR04.02_ThirdParty/testing
+			#liblog4vendor
+			log4cplus/1.2.1@LR04.02_ThirdParty/stable
+			)
 else()
 	set(CONAN_CURPLATFORM_LIB_NAMES
+			#mod_snapshot mod_screenshot mod_RomoteController mod_UpgradeRun mod_upload libscreencodec 
+			#zlib/1.2.11@LR04.02_ThirdParty/stable
+			#mod_download mod_evtconverter mod_ThermalPrint
+			expat/2.1.0@LR04.02_ThirdParty/testing
+			#mod_ThermalPrint mod_evtconverter mod_download
+			scew/1.1.7@LR04.02_ThirdParty/testing
 			#mod_sipphone mod_IDCertificate libwmvrecord mod_livenessdetection mod_screenshot mod_snapshot libfacecapture libimageproc
 			opencv/3.1.0@LR04.02_ThirdParty/stable
 			#mod_sipphone
@@ -68,9 +83,10 @@ else()
 			SDL2/2.0.12@LR04.02_ThirdParty/dynamic
 			#mod_screenshot
 			libX11/1.6@LR04.02_ThirdParty/testing
+			#liblog4vendor
+			log4cplus/1.2.1@LR04.02_ThirdParty/slim # !!!!support build missing!!!!
 			#mod_resourceWatcher
 			sogoulib/2021.1008.01@LR04.02_VendorLib/testing
-
 			cpprestsdk/2.10.15@LR04.02_ThirdParty/testing
 			)