Added build files for windows and executables for linux and windows under .zip folders
This commit is contained in:
@@ -34,9 +34,9 @@ if(WIN32)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib/maxminddb.lib
|
||||
)
|
||||
else()
|
||||
# Windows via MinGW/GCC Toolchain
|
||||
# Windows via MinGW/GCC Cross-Toolchain (FIXED: Points to your new library file)
|
||||
target_link_libraries(LumberJack_core PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib/libmaxminddb.a
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib/mingw_libmaxminddb.a
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -58,9 +58,13 @@ elseif(APPLE)
|
||||
|
||||
else()
|
||||
# Standard Linux (Ubuntu, Arch Linux, Fedora, etc.)
|
||||
target_link_libraries(LumberJack_core PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib/libmaxminddb.a
|
||||
)
|
||||
# OPTIMIZATION: Try finding system-installed libmaxminddb first, fallback to local file if missing
|
||||
find_library(MAXMIND_LINUX maxminddb)
|
||||
if(MAXMIND_LINUX)
|
||||
target_link_libraries(LumberJack_core PRIVATE ${MAXMIND_LINUX})
|
||||
else()
|
||||
target_link_libraries(LumberJack_core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib/libmaxminddb.a)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Version definitions needed by your GeoLite2PP wrapper
|
||||
@@ -83,15 +87,30 @@ FetchContent_MakeAvailable(ftxui)
|
||||
# ==========================================
|
||||
add_executable(LumberJack main.cpp)
|
||||
|
||||
target_link_libraries(LumberJack
|
||||
PRIVATE
|
||||
LumberJack_core
|
||||
ftxui::screen
|
||||
ftxui::dom
|
||||
ftxui::component
|
||||
# Second: Link your internal libraries and FTXUI
|
||||
target_link_libraries(LumberJack PRIVATE
|
||||
LumberJack_core
|
||||
ftxui::screen
|
||||
ftxui::dom
|
||||
ftxui::component
|
||||
)
|
||||
|
||||
# CROSS-PLATFORM FIXED: Output targets route uniformly into the root project space
|
||||
# Third: Apply your static linking flags (Target now exists safely!)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
if(WIN32)
|
||||
if(MSVC)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
|
||||
else()
|
||||
target_link_options(LumberJack PRIVATE -static)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES)
|
||||
else()
|
||||
target_link_options(LumberJack PRIVATE -static-libgcc -static-libstdc++)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Fourth: Set directory runtime properties
|
||||
set_target_properties(LumberJack PROPERTIES
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
|
||||
Reference in New Issue
Block a user