Change to use precompiled libs

This commit is contained in:
Nikola Petrov 2025-01-31 12:31:50 +01:00
parent 3ea3ef7c11
commit c1921dd3ac
2 changed files with 15 additions and 35 deletions

3
.gitignore vendored
View File

@ -11,4 +11,5 @@ treender
*.vcxproj*
Console*/
main
*.bin
*.bin
external

View File

@ -5,34 +5,17 @@ project(MyProject)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
# set(CMAKE_VERBOSE_MAKEFILE ON)
add_compile_options(-ggdb)
include(ExternalProject)
ExternalProject_Add(
sqlite
PREFIX ""
URL https://www.sqlite.org/2025/sqlite-amalgamation-3480000.zip
URL_HASH SHA256=d9a15a42db7c78f88fe3d3c5945acce2f4bfe9e4da9f685cd19f6ea1d40aa884
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/downloads
SOURCE_DIR ${CMAKE_BINARY_DIR}/sqlite
CONFIGURE_COMMAND ""
BUILD_COMMAND
${CMAKE_C_COMPILER} -c ${CMAKE_BINARY_DIR}/sqlite/sqlite3.c -o ${CMAKE_BINARY_DIR}/sqlite-prefix/sqlite3.o -DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_USE_ALLOCA -DSQLITE_OMIT_AUTOINIT -DSQLITE_STRICT_SUBTYPE=1 -DSQLITE_THREADSAFE=2 &&
${CMAKE_AR} rcs ${CMAKE_BINARY_DIR}/sqlite-prefix/libsqlite3.a ${CMAKE_BINARY_DIR}/sqlite-prefix/sqlite3.o
INSTALL_COMMAND ""
)
ExternalProject_Add(
raylib
PREFIX ""
URL https://github.com/raysan5/raylib/releases/download/5.5/raylib-5.5_linux_amd64.tar.gz
URL_HASH SHA256=3d95ef03d5b38dfa55c0a16ca122d382134b078f0e5b270b52fe7eae0549c000
DOWNLOAD_DIR ${CMAKE_BINARY_DIR}/downloads
SOURCE_DIR ${CMAKE_BINARY_DIR}/raylib
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
include_directories(external/include/)
link_libraries(
${CMAKE_SOURCE_DIR}/external/libimgui.a
${CMAKE_SOURCE_DIR}/external/libraylib.a
${CMAKE_SOURCE_DIR}/external/libsqlite3.a
pthread
dl
m
)
add_executable(app
@ -51,8 +34,7 @@ add_executable(app
shared/src/TcpSocket.cpp
)
# Add include directories
target_include_directories(app PRIVATE app/inc shared/inc ${CMAKE_BINARY_DIR}/raylib/include)
target_link_libraries(app ${CMAKE_BINARY_DIR}/raylib/lib/libraylib.a)
target_include_directories(app PRIVATE app/inc shared/inc )
add_executable(server
server/src/server.cpp
@ -65,9 +47,7 @@ add_executable(server
shared/src/values/mrand.cpp
)
# Add include directories
target_include_directories(server PRIVATE server/inc shared/inc ${CMAKE_BINARY_DIR}/sqlite/)
target_link_libraries(server PRIVATE pthread dl m ${CMAKE_BINARY_DIR}/sqlite-prefix/libsqlite3.a)
target_include_directories(server PRIVATE server/inc shared/inc)
add_executable(view
view/src/main.cpp
@ -84,5 +64,4 @@ add_executable(view
shared/src/sql.cpp
)
# Add include directories
target_include_directories(view PRIVATE view/inc shared/inc ${CMAKE_BINARY_DIR}/sqlite/ ${CMAKE_BINARY_DIR}/raylib/include)
target_link_libraries(view PRIVATE pthread dl m ${CMAKE_BINARY_DIR}/sqlite-prefix/libsqlite3.a ${CMAKE_BINARY_DIR}/raylib/lib/libraylib.a)
target_include_directories(view PRIVATE view/inc shared/inc)