Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Commit

Permalink
fix build command
Browse files Browse the repository at this point in the history
  • Loading branch information
liuguangw committed Dec 31, 2021
1 parent 5d7592f commit 9783363
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,12 @@ add_executable(${PROJECT_NAME} main.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,./lib")
target_link_libraries(${PROJECT_NAME} server)
file(COPY config.yaml DESTINATION ${PROJECT_BINARY_DIR})
# compress
if (NOT (${BUILD_SHARED_LIBS}))
find_program(UPX_BIN upx)
if (NOT ("${UPX_BIN}" STREQUAL "UPX_BIN-NOTFOUND"))
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND echo "using upx ..."
COMMAND ${UPX_BIN} --best ${PROJECT_BINARY_DIR}/${PROJECT_NAME})
endif ()
endif ()

0 comments on commit 9783363

Please sign in to comment.