From a8fd1bdada1fcc2aba34a3d141b61fdd2274bf6d Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sat, 17 Aug 2024 15:33:06 -0700 Subject: [PATCH] use new CMake configs from phosg and resource_dasm --- CMakeLists.txt | 25 ++++++++++--------------- src/Main.cc | 7 ++++++- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b51b2876..4d46cd38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,12 +14,6 @@ else() add_compile_options(-Wall -Wextra -Werror -Wno-address-of-packed-member) endif() -set(LOCAL_INCLUDE_DIR "/usr/local/include") -set(LOCAL_LIB_DIR "/usr/local/lib") -list(APPEND CMAKE_PREFIX_PATH ${LOCAL_LIB_DIR}) -include_directories(${LOCAL_INCLUDE_DIR}) -link_directories(${LOCAL_LIB_DIR}) - # Library search @@ -141,20 +135,19 @@ endif() add_executable(newserv ${SOURCES}) target_include_directories(newserv PUBLIC ${LIBEVENT_INCLUDE_DIR} ${Iconv_INCLUDE_DIRS}) -target_link_libraries(newserv phosg ${LIBEVENT_LIBRARIES} ${Iconv_LIBRARIES} pthread) +target_link_libraries(newserv phosg::phosg ${LIBEVENT_LIBRARIES} ${Iconv_LIBRARIES} pthread) +if(resource_file_FOUND) + target_compile_definitions(newserv PUBLIC HAVE_RESOURCE_FILE) + target_link_libraries(newserv resource_file::resource_file) + message(STATUS "resource_file found; enabling patch support") +else() + message(WARNING "resource_file not found; disabling patch support") +endif() add_dependencies(newserv newserv-Revision-cc) # target_compile_options(newserv PRIVATE -fsanitize=address) # target_link_options(newserv PRIVATE -fsanitize=address) -if(resource_file_FOUND) - target_compile_definitions(newserv PUBLIC HAVE_RESOURCE_FILE) - target_link_libraries(newserv resource_file) - message(STATUS "libresource_file found; enabling patch support") -else() - message(WARNING "libresource_file not found; disabling patch support") -endif() - # Test configuration @@ -179,6 +172,8 @@ foreach(ScriptTestCase IN ITEMS ${ScriptTestCases}) COMMAND ${ScriptTestCase} ${CMAKE_BINARY_DIR}/newserv) endforeach() + + # Installation configuration install(TARGETS newserv DESTINATION bin) diff --git a/src/Main.cc b/src/Main.cc index 9fdc4d36..2c723258 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -2510,7 +2510,12 @@ Action a_run_server_replay_log( "", nullptr, +[](phosg::Arguments& args) { { string build_date = phosg::format_time(BUILD_TIMESTAMP); - config_log.info("newserv %s compiled at %s", GIT_REVISION_HASH, build_date.c_str()); +#ifdef HAVE_RESOURCE_FILE + const char* resource_file_str = " with client function support"; +#else + const char* resource_file_str = " without client function support"; +#endif + config_log.info("newserv %s compiled%s at %s", GIT_REVISION_HASH, resource_file_str, build_date.c_str()); } if (evthread_use_pthreads()) {