diff --git a/CMakeLists.txt b/CMakeLists.txt index dd514fac..ce0234dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,9 +43,12 @@ target_compile_definitions(project_definitions WIN32 WIN64 "_WIN32_WINNT=0x0601" _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING ) -target_compile_options(project_compile_options INTERFACE /utf-8) -target_link_options(msvc_gui_link_options INTERFACE /SUBSYSTEM:WINDOWS /NOLOGO) -target_link_options(msvc_console_link_options INTERFACE /SUBSYSTEM:CONSOLE /NOLOGO) + +# /Oy and /RELEASE are added to avoid tripping malware detection +# this is quite random, ymmv +target_compile_options(project_compile_options INTERFACE /utf-8 /Oy) +target_link_options(msvc_gui_link_options INTERFACE /SUBSYSTEM:WINDOWS /NOLOGO /RELEASE) +target_link_options(msvc_console_link_options INTERFACE /SUBSYSTEM:CONSOLE /NOLOGO /RELEASE) add_library(project::definitions ALIAS project_definitions) add_library(project::compile_features ALIAS project_compile_features) diff --git a/application/DebugViewConsole/CMakeLists.txt b/application/DebugViewConsole/CMakeLists.txt index b1f8acaf..cf0d6976 100644 --- a/application/DebugViewConsole/CMakeLists.txt +++ b/application/DebugViewConsole/CMakeLists.txt @@ -20,5 +20,17 @@ target_include_directories(DebugViewConsole PUBLIC $ ) -get_property(EXE_NAME TARGET DebugViewConsole PROPERTY TARGET_FILE_NAME) -add_custom_command(TARGET DebugViewConsole POST_BUILD COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe --best $) +add_custom_command( + TARGET DebugViewConsole + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + $ + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe +) + +install(CODE " + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe) + execute_process(COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe) +") + +INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DebugViewConsole-small.exe DESTINATION bin) \ No newline at end of file diff --git a/application/DebugViewpp/CMakeLists.txt b/application/DebugViewpp/CMakeLists.txt index 311382f3..14face30 100644 --- a/application/DebugViewpp/CMakeLists.txt +++ b/application/DebugViewpp/CMakeLists.txt @@ -44,6 +44,9 @@ target_include_directories(Debugviewpp PUBLIC $ ) -get_property(EXE_NAME TARGET Debugviewpp PROPERTY TARGET_FILE_NAME) -add_custom_command(TARGET Debugviewpp POST_BUILD COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe --best $) +install(CODE " + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe) + execute_process(COMMAND ${PROJECT_UTILS_DIRECTORY}/upx.exe ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe) +") +INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debugviewpp-small.exe DESTINATION bin) \ No newline at end of file diff --git a/utils/upx.exe b/utils/upx.exe index fdbde847..50aac926 100644 Binary files a/utils/upx.exe and b/utils/upx.exe differ