From cc438a5bbbbe368f2194f91157d8c9b40b666df2 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 16 Sep 2024 00:30:45 +0800 Subject: [PATCH 1/3] chore: remove DebWithRelDeps --- CMakeLists.txt | 1 - CMakePresets.json | 24 ------------------------ cmake/config.cmake | 10 +--------- 3 files changed, 1 insertion(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c37a1108e..195a10092 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ project(MaaFw) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") set_property(GLOBAL PROPERTY USE_FOLDERS ON) -set(CMAKE_MAP_IMPORTED_CONFIG_DebWithRelDeps "DebWithRelDeps;Release;") set(Boost_NO_WARN_NEW_VERSIONS ON) diff --git a/CMakePresets.json b/CMakePresets.json index 2cb548180..e10d3549a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -69,14 +69,6 @@ "configuration": "Debug", "jobs": 16 }, - { - "name": "NinjaMulti - DebWithRelDeps", - "displayName": "Ninja MultiConfig DebWithRelDeps", - "description": "Ninja MultiConfig DebWithRelDeps", - "configurePreset": "NinjaMulti", - "configuration": "RelWithDebInfo", - "jobs": 16 - }, { "name": "NinjaMulti - Release", "displayName": "Ninja MultiConfig Release", @@ -93,14 +85,6 @@ "configuration": "Debug", "jobs": 16 }, - { - "name": "NinjaMulti Win32 - DebWithRelDeps", - "displayName": "Ninja NinjaMulti Win32 DebWithRelDeps", - "description": "Ninja NinjaMulti Win32 DebWithRelDeps", - "configurePreset": "NinjaMulti Win32", - "configuration": "RelWithDebInfo", - "jobs": 16 - }, { "name": "NinjaMulti Win32 - Release", "displayName": "Ninja NinjaMulti Win32 Release", @@ -117,14 +101,6 @@ "configuration": "Debug", "jobs": 16 }, - { - "name": "MSVC 2022 - DebWithRelDeps", - "displayName": "MSVC 2022 DebWithRelDeps", - "description": "MSVC 2022 DebWithRelDeps", - "configurePreset": "MSVC 2022", - "configuration": "DebWithRelDeps", - "jobs": 16 - }, { "name": "MSVC 2022 - Release", "displayName": "MSVC 2022 Release", diff --git a/cmake/config.cmake b/cmake/config.cmake index 7c24955a2..318df1ce3 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -1,9 +1,6 @@ set(debug_comp_defs "_DEBUG;MAA_DEBUG") add_compile_definitions("$<$:${debug_comp_defs}>") -set(rel_debug_comp_defs "MAA_DEBUG") -add_compile_definitions("$<$:${rel_debug_comp_defs}>") - if(APPLE) set(CMAKE_INSTALL_RPATH "@loader_path;@executable_path") set(CMAKE_BUILD_RPATH "@loader_path;@executable_path") @@ -25,9 +22,6 @@ if(MSVC) # https://github.com/actions/runner-images/issues/10004 https://github.com/microsoft/STL/releases/tag/vs-2022-17.10 add_compile_definitions("_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR") - set(rel_debug_comp_options "/Od") - add_compile_options("$<$:${rel_debug_comp_options}>") - set(release_link_options "/OPT:REF;/OPT:ICF") add_link_options("$<$:${release_link_options}>") @@ -51,12 +45,10 @@ else() add_link_options("-L${DIR}") set(CMAKE_BUILD_RPATH "${CMAKE_BUILD_RPATH};${DIR};${DIR}/..") endif() + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${DIR};${DIR}/..") endforeach() endif() - - set(rel_debug_comp_options "-O0") - add_compile_options("$<$:${rel_debug_comp_options}>") endif() set(CMAKE_CXX_STANDARD 20) From 3c8d97a6299c76fb0814ae54df518874b085029d Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 8 Dec 2024 11:50:27 +0800 Subject: [PATCH 2/3] build: add symbol --- source/MaaAdbControlUnit/CMakeLists.txt | 4 ++++ source/MaaDbgControlUnit/CMakeLists.txt | 4 ++++ source/MaaFramework/CMakeLists.txt | 5 +++++ source/MaaProjectInterface/CLI/CMakeLists.txt | 4 ++++ source/MaaToolkit/CMakeLists.txt | 5 +++++ source/MaaUtils/CMakeLists.txt | 4 ++++ source/MaaWin32ControlUnit/CMakeLists.txt | 4 ++++ source/binding/NodeJS/CMakeLists.txt | 14 +++++++++----- test/dlopen/CMakeLists.txt | 4 ++++ test/pipeline/CMakeLists.txt | 4 ++++ 10 files changed, 47 insertions(+), 5 deletions(-) diff --git a/source/MaaAdbControlUnit/CMakeLists.txt b/source/MaaAdbControlUnit/CMakeLists.txt index 8438b6ca8..f6c1554f6 100644 --- a/source/MaaAdbControlUnit/CMakeLists.txt +++ b/source/MaaAdbControlUnit/CMakeLists.txt @@ -24,4 +24,8 @@ install( # ARCHIVE DESTINATION lib ) +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_adb_control_unit_src}) diff --git a/source/MaaDbgControlUnit/CMakeLists.txt b/source/MaaDbgControlUnit/CMakeLists.txt index 7171abb0d..0ca7bf90f 100644 --- a/source/MaaDbgControlUnit/CMakeLists.txt +++ b/source/MaaDbgControlUnit/CMakeLists.txt @@ -20,4 +20,8 @@ install( # ARCHIVE DESTINATION lib ) +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_dbg_control_unit_src}) diff --git a/source/MaaFramework/CMakeLists.txt b/source/MaaFramework/CMakeLists.txt index fed6ad3ec..27dbb5756 100644 --- a/source/MaaFramework/CMakeLists.txt +++ b/source/MaaFramework/CMakeLists.txt @@ -33,6 +33,11 @@ install( RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib) + +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + install(DIRECTORY "${MAA_PUBLIC_INC}/MaaFramework" DESTINATION "include") source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_framework_src}) diff --git a/source/MaaProjectInterface/CLI/CMakeLists.txt b/source/MaaProjectInterface/CLI/CMakeLists.txt index 0101472d3..957846d61 100644 --- a/source/MaaProjectInterface/CLI/CMakeLists.txt +++ b/source/MaaProjectInterface/CLI/CMakeLists.txt @@ -16,3 +16,7 @@ install(TARGETS MaaPiCli RUNTIME DESTINATION bin LIBRARY DESTINATION bin ) + +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() \ No newline at end of file diff --git a/source/MaaToolkit/CMakeLists.txt b/source/MaaToolkit/CMakeLists.txt index 5d6d5033e..e67b4fc2e 100644 --- a/source/MaaToolkit/CMakeLists.txt +++ b/source/MaaToolkit/CMakeLists.txt @@ -23,6 +23,11 @@ install( RUNTIME DESTINATION bin LIBRARY DESTINATION bin ARCHIVE DESTINATION lib) + +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + install(DIRECTORY "${MAA_PUBLIC_INC}/MaaToolkit" DESTINATION "include") source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_toolkit_src}) diff --git a/source/MaaUtils/CMakeLists.txt b/source/MaaUtils/CMakeLists.txt index a49c55ac0..ada0c399d 100644 --- a/source/MaaUtils/CMakeLists.txt +++ b/source/MaaUtils/CMakeLists.txt @@ -19,4 +19,8 @@ install( LIBRARY DESTINATION bin # ARCHIVE DESTINATION lib ) +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_utils_src}) diff --git a/source/MaaWin32ControlUnit/CMakeLists.txt b/source/MaaWin32ControlUnit/CMakeLists.txt index a0fbfb2c4..19b6a56b9 100644 --- a/source/MaaWin32ControlUnit/CMakeLists.txt +++ b/source/MaaWin32ControlUnit/CMakeLists.txt @@ -21,4 +21,8 @@ install( # ARCHIVE DESTINATION lib ) +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_win32_control_unit_src}) diff --git a/source/binding/NodeJS/CMakeLists.txt b/source/binding/NodeJS/CMakeLists.txt index 564519ced..e8e74c26a 100644 --- a/source/binding/NodeJS/CMakeLists.txt +++ b/source/binding/NodeJS/CMakeLists.txt @@ -12,8 +12,8 @@ endif() set(NODE_RUNTIME "node") set(NODE_RUNTIMEVERSION "20.11.1") -# set(NODE_ARCH "x64") +# set(NODE_ARCH "x64") if(WIN32) set(CMAKE_JS_LIB "${CMAKE_BINARY_DIR}/node.lib") set(CMAKE_JS_NODELIB_DEF "${CMAKE_CURRENT_LIST_DIR}/node_modules/node-api-headers/def/node_api.def") @@ -49,15 +49,15 @@ target_link_libraries(MaaNode ${CMAKE_JS_LIB} MaaFramework MaaToolkit) target_compile_definitions(MaaNode PRIVATE NODE_ADDON_API_ENABLE_TYPE_CHECK_ON_AS) if(WIN32 - AND CMAKE_JS_NODELIB_DEF - AND CMAKE_JS_NODELIB_TARGET) + AND CMAKE_JS_NODELIB_DEF + AND CMAKE_JS_NODELIB_TARGET) # Generate node.lib if(MSVC) execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} - ${CMAKE_STATIC_LINKER_FLAGS}) + ${CMAKE_STATIC_LINKER_FLAGS}) else() execute_process(COMMAND ${CMAKE_LINKER} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} - ${CMAKE_STATIC_LINKER_FLAGS}) + ${CMAKE_STATIC_LINKER_FLAGS}) endif() endif() @@ -67,5 +67,9 @@ install( LIBRARY DESTINATION bin ARCHIVE DESTINATION lib) +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() + # if(WIN32) add_custom_command( TARGET MaaNode POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${MaaDlls} # $ COMMAND_EXPAND_LISTS) endif() diff --git a/test/dlopen/CMakeLists.txt b/test/dlopen/CMakeLists.txt index 9c2e47be5..bb1f5f4e1 100644 --- a/test/dlopen/CMakeLists.txt +++ b/test/dlopen/CMakeLists.txt @@ -29,3 +29,7 @@ add_dependencies(DlopenTesting LibraryHolder) set_target_properties(DlopenTesting PROPERTIES FOLDER Testing) install(TARGETS DlopenTesting RUNTIME DESTINATION bin) + +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() diff --git a/test/pipeline/CMakeLists.txt b/test/pipeline/CMakeLists.txt index f7d5617df..8ed8d19ff 100644 --- a/test/pipeline/CMakeLists.txt +++ b/test/pipeline/CMakeLists.txt @@ -13,3 +13,7 @@ add_dependencies(PipelineTesting MaaFramework PipelineSmokingResource) set_target_properties(PipelineTesting PROPERTIES FOLDER Testing) install(TARGETS PipelineTesting RUNTIME DESTINATION bin) + +if(WIN32) + install(FILES $ DESTINATION symbol) +endif() From 99adcddb1ff802cc19caee71a38f089477f1a8c0 Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 8 Dec 2024 12:35:17 +0800 Subject: [PATCH 3/3] build: symbol OPTIONAL --- source/MaaAdbControlUnit/CMakeLists.txt | 2 +- source/MaaDbgControlUnit/CMakeLists.txt | 2 +- source/MaaFramework/CMakeLists.txt | 2 +- source/MaaProjectInterface/CLI/CMakeLists.txt | 2 +- source/MaaToolkit/CMakeLists.txt | 2 +- source/MaaUtils/CMakeLists.txt | 2 +- source/MaaWin32ControlUnit/CMakeLists.txt | 2 +- source/binding/NodeJS/CMakeLists.txt | 2 +- test/dlopen/CMakeLists.txt | 2 +- test/pipeline/CMakeLists.txt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/source/MaaAdbControlUnit/CMakeLists.txt b/source/MaaAdbControlUnit/CMakeLists.txt index f6c1554f6..9cea04247 100644 --- a/source/MaaAdbControlUnit/CMakeLists.txt +++ b/source/MaaAdbControlUnit/CMakeLists.txt @@ -25,7 +25,7 @@ install( ) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_adb_control_unit_src}) diff --git a/source/MaaDbgControlUnit/CMakeLists.txt b/source/MaaDbgControlUnit/CMakeLists.txt index 0ca7bf90f..2b54487de 100644 --- a/source/MaaDbgControlUnit/CMakeLists.txt +++ b/source/MaaDbgControlUnit/CMakeLists.txt @@ -21,7 +21,7 @@ install( ) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_dbg_control_unit_src}) diff --git a/source/MaaFramework/CMakeLists.txt b/source/MaaFramework/CMakeLists.txt index 27dbb5756..9a5585602 100644 --- a/source/MaaFramework/CMakeLists.txt +++ b/source/MaaFramework/CMakeLists.txt @@ -35,7 +35,7 @@ install( ARCHIVE DESTINATION lib) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() install(DIRECTORY "${MAA_PUBLIC_INC}/MaaFramework" DESTINATION "include") diff --git a/source/MaaProjectInterface/CLI/CMakeLists.txt b/source/MaaProjectInterface/CLI/CMakeLists.txt index 957846d61..cf8fce12c 100644 --- a/source/MaaProjectInterface/CLI/CMakeLists.txt +++ b/source/MaaProjectInterface/CLI/CMakeLists.txt @@ -18,5 +18,5 @@ install(TARGETS MaaPiCli ) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() \ No newline at end of file diff --git a/source/MaaToolkit/CMakeLists.txt b/source/MaaToolkit/CMakeLists.txt index e67b4fc2e..9b793705b 100644 --- a/source/MaaToolkit/CMakeLists.txt +++ b/source/MaaToolkit/CMakeLists.txt @@ -25,7 +25,7 @@ install( ARCHIVE DESTINATION lib) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() install(DIRECTORY "${MAA_PUBLIC_INC}/MaaToolkit" DESTINATION "include") diff --git a/source/MaaUtils/CMakeLists.txt b/source/MaaUtils/CMakeLists.txt index ada0c399d..02f25f459 100644 --- a/source/MaaUtils/CMakeLists.txt +++ b/source/MaaUtils/CMakeLists.txt @@ -20,7 +20,7 @@ install( ) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_utils_src}) diff --git a/source/MaaWin32ControlUnit/CMakeLists.txt b/source/MaaWin32ControlUnit/CMakeLists.txt index 19b6a56b9..bdaff12c3 100644 --- a/source/MaaWin32ControlUnit/CMakeLists.txt +++ b/source/MaaWin32ControlUnit/CMakeLists.txt @@ -22,7 +22,7 @@ install( ) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_win32_control_unit_src}) diff --git a/source/binding/NodeJS/CMakeLists.txt b/source/binding/NodeJS/CMakeLists.txt index e8e74c26a..682ce71e2 100644 --- a/source/binding/NodeJS/CMakeLists.txt +++ b/source/binding/NodeJS/CMakeLists.txt @@ -68,7 +68,7 @@ install( ARCHIVE DESTINATION lib) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() # if(WIN32) add_custom_command( TARGET MaaNode POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${MaaDlls} diff --git a/test/dlopen/CMakeLists.txt b/test/dlopen/CMakeLists.txt index bb1f5f4e1..c3fd152bb 100644 --- a/test/dlopen/CMakeLists.txt +++ b/test/dlopen/CMakeLists.txt @@ -31,5 +31,5 @@ set_target_properties(DlopenTesting PROPERTIES FOLDER Testing) install(TARGETS DlopenTesting RUNTIME DESTINATION bin) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif() diff --git a/test/pipeline/CMakeLists.txt b/test/pipeline/CMakeLists.txt index 8ed8d19ff..a79a441cc 100644 --- a/test/pipeline/CMakeLists.txt +++ b/test/pipeline/CMakeLists.txt @@ -15,5 +15,5 @@ set_target_properties(PipelineTesting PROPERTIES FOLDER Testing) install(TARGETS PipelineTesting RUNTIME DESTINATION bin) if(WIN32) - install(FILES $ DESTINATION symbol) + install(FILES $ DESTINATION symbol OPTIONAL) endif()