prepare for release
This commit is contained in:
@@ -3,7 +3,7 @@ project(CrowHTMX)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
set(TARGET_NAME lf-server-admin-panel )
|
||||
set(TARGET_NAME shadowrun-server )
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@@ -20,15 +20,15 @@ if(NOT CMAKE_BUILD_TYPE IN_LIST SUPPORTED_BUILD_TYPES)
|
||||
endif()
|
||||
|
||||
# Copy 'static' and 'templates' directories to build directory
|
||||
file(GLOB_RECURSE STATIC_FILES "${CMAKE_SOURCE_DIR}/static/*")
|
||||
file(GLOB_RECURSE TEMPLATE_FILES "${CMAKE_SOURCE_DIR}/templates/*")
|
||||
file(GLOB_RECURSE ASSETS_FILES "${CMAKE_SOURCE_DIR}/assets/*")
|
||||
file(GLOB_RECURSE FRONTEND_FILES "${CMAKE_SOURCE_DIR}/frontend/build/*")
|
||||
|
||||
foreach(file IN LISTS STATIC_FILES)
|
||||
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}")
|
||||
configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY)
|
||||
endforeach()
|
||||
|
||||
foreach(file IN LISTS TEMPLATE_FILES)
|
||||
foreach(file IN LISTS FRONTEND_FILES)
|
||||
file(RELATIVE_PATH rel_path "${CMAKE_SOURCE_DIR}" "${file}")
|
||||
configure_file("${file}" "${CMAKE_BINARY_DIR}/${rel_path}" COPYONLY)
|
||||
endforeach()
|
||||
@@ -36,22 +36,18 @@ endforeach()
|
||||
include_directories(
|
||||
modules/cpp-libraries/include/
|
||||
src
|
||||
src/htmx
|
||||
src/shadowrun
|
||||
src/database
|
||||
src/login
|
||||
)
|
||||
|
||||
add_executable(${TARGET_NAME}
|
||||
# sqlite3
|
||||
modules/cpp-libraries/src/sqlite3.c
|
||||
modules/cpp-libraries/src/monocypher.c
|
||||
|
||||
src/main.cpp
|
||||
src/utils.hpp
|
||||
src/utils.cpp
|
||||
src/systemd.cpp
|
||||
src/systemd.h
|
||||
src/json_settings.cpp
|
||||
src/json_settings.h
|
||||
|
||||
@@ -80,9 +76,23 @@ target_compile_options(${TARGET_NAME} PRIVATE
|
||||
>
|
||||
)
|
||||
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE APPLICATION_NAME="${TARGET_NAME}")
|
||||
# relase compiler options
|
||||
target_compile_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:-O3>
|
||||
$<$<CONFIG:Release>:-flto=auto>
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME} pthread sodium)
|
||||
# relase linker options
|
||||
target_link_options(${TARGET_NAME} PRIVATE
|
||||
$<$<CONFIG:Release>:-flto=auto>
|
||||
)
|
||||
|
||||
target_compile_definitions(${TARGET_NAME} PRIVATE
|
||||
APPLICATION_NAME="${TARGET_NAME}"
|
||||
SQLITE_THREADSAFE=1
|
||||
)
|
||||
|
||||
target_link_libraries(${TARGET_NAME} pthread)
|
||||
|
||||
# Optional: Print build type at configuration time
|
||||
message(STATUS "Configuring build type: ${CMAKE_BUILD_TYPE}")
|
||||
Reference in New Issue
Block a user