summaryrefslogtreecommitdiffstatshomepage
path: root/src/utils/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/CMakeLists.txt')
-rw-r--r--src/utils/CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
new file mode 100644
index 0000000..51ab17d
--- /dev/null
+++ b/src/utils/CMakeLists.txt
@@ -0,0 +1,27 @@
+find_package(Boost CONFIG REQUIRED COMPONENTS program_options)
+
+function(add_util name src)
+ add_executable("${name}" ${src})
+ target_link_libraries("${name}" PRIVATE winapi_debug)
+ target_link_libraries("${name}" PRIVATE Boost::disable_autolinking Boost::program_options)
+ install(TARGETS "${name}" RUNTIME DESTINATION bin)
+ if(MSVC)
+ install(FILES "$<TARGET_PDB_FILE:${name}>" DESTINATION bin OPTIONAL)
+ endif()
+endfunction()
+
+add_util(enum_symbols enum_symbols.cpp command_line.hpp pdb_descr.hpp)
+add_util(name2addr name2addr.cpp)
+add_util(addr2name addr2name.cpp command_line.hpp pdb_descr.hpp)
+
+if(MSVC)
+ find_package(Python3 REQUIRED COMPONENTS Interpreter)
+ add_test(NAME enum_symbols COMMAND Python3::Interpreter
+ "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/tools/ctest-driver.py"
+ run
+ --pass-regex test_ns::baz test_ns::bar test_ns::foo test_ns::var
+ --
+ "$<TARGET_FILE:enum_symbols>"
+ --pdb "$<TARGET_PDB_FILE:test_lib>"
+ --mask "test_ns:*")
+endif()