Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add symbol #452

Merged
merged 4 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
24 changes: 0 additions & 24 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
9 changes: 0 additions & 9 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
set(debug_comp_defs "_DEBUG;MAA_DEBUG")
add_compile_definitions("$<$<CONFIG:Debug>:${debug_comp_defs}>")

set(rel_debug_comp_defs "MAA_DEBUG")
add_compile_definitions("$<$<CONFIG:DebWithRelDeps>:${rel_debug_comp_defs}>")

if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path;@executable_path")
set(CMAKE_BUILD_RPATH "@loader_path;@executable_path")
Expand All @@ -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("$<$<CONFIG:DebWithRelDeps>:${rel_debug_comp_options}>")

set(release_link_options "/OPT:REF;/OPT:ICF")
add_link_options("$<$<CONFIG:Release>:${release_link_options}>")

Expand Down Expand Up @@ -59,9 +53,6 @@ else()

endforeach()
endif()

set(rel_debug_comp_options "-O0")
add_compile_options("$<$<CONFIG:DebWithRelDeps>:${rel_debug_comp_options}>")
endif()

set(CMAKE_CXX_STANDARD 20)
Expand Down
4 changes: 4 additions & 0 deletions source/MaaAdbControlUnit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@ install(
# ARCHIVE DESTINATION lib
)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaAdbControlUnit> DESTINATION symbol OPTIONAL)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_adb_control_unit_src})
4 changes: 4 additions & 0 deletions source/MaaDbgControlUnit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ install(
# ARCHIVE DESTINATION lib
)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaDbgControlUnit> DESTINATION symbol OPTIONAL)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_dbg_control_unit_src})
5 changes: 5 additions & 0 deletions source/MaaFramework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ install(
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaFramework> DESTINATION symbol OPTIONAL)
endif()

install(DIRECTORY "${MAA_PUBLIC_INC}/MaaFramework" DESTINATION "include")

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_framework_src})
Expand Down
4 changes: 4 additions & 0 deletions source/MaaProjectInterface/CLI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ install(TARGETS MaaPiCli
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaPiCli> DESTINATION symbol OPTIONAL)
endif()
5 changes: 5 additions & 0 deletions source/MaaToolkit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ install(
RUNTIME DESTINATION bin
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaToolkit> DESTINATION symbol OPTIONAL)
endif()

install(DIRECTORY "${MAA_PUBLIC_INC}/MaaToolkit" DESTINATION "include")

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_toolkit_src})
4 changes: 4 additions & 0 deletions source/MaaUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ install(
LIBRARY DESTINATION bin # ARCHIVE DESTINATION lib
)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaUtils> DESTINATION symbol OPTIONAL)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_utils_src})
4 changes: 4 additions & 0 deletions source/MaaWin32ControlUnit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ install(
# ARCHIVE DESTINATION lib
)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaWin32ControlUnit> DESTINATION symbol OPTIONAL)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_win32_control_unit_src})
14 changes: 9 additions & 5 deletions source/binding/NodeJS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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()

Expand All @@ -67,5 +67,9 @@ install(
LIBRARY DESTINATION bin
ARCHIVE DESTINATION lib)

if(WIN32)
install(FILES $<TARGET_PDB_FILE:MaaNode> DESTINATION symbol OPTIONAL)
endif()

# if(WIN32) add_custom_command( TARGET MaaNode POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${MaaDlls}
# $<TARGET_FILE_DIR:MaaNode> COMMAND_EXPAND_LISTS) endif()
4 changes: 4 additions & 0 deletions test/dlopen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_PDB_FILE:DlopenTesting> DESTINATION symbol OPTIONAL)
endif()
4 changes: 4 additions & 0 deletions test/pipeline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_PDB_FILE:PipelineTesting> DESTINATION symbol OPTIONAL)
endif()
Loading