diff --git a/CMakeLists.txt b/CMakeLists.txt index c97f3c0..8bd43fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,11 +5,13 @@ include(GNUInstallDirs) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) -include_directories(external/stb) +include_directories(external/stb external/lz4) set(MW_INSTALL_HEADERS OFF) add_subdirectory(external/milsko) +add_subdirectory(external/lz4) + add_subdirectory(engine) add_subdirectory(client) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 9fa906f..641203f 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -16,13 +16,13 @@ macro(install_target name) ) endmacro() -file(GLOB GearSrc_SRC src/*.c lz4/*.c) +file(GLOB GearSrc_SRC src/*.c) add_library(GearSrc SHARED ${GearSrc_SRC}) target_include_directories(GearSrc PUBLIC include) target_include_directories(GearSrc PRIVATE lz4) target_compile_definitions(GearSrc PRIVATE _GEARSRC) -target_link_libraries(GearSrc PRIVATE ode) +target_link_libraries(GearSrc PRIVATE ode lz4) target_link_options(GearSrc PRIVATE -static-libgcc -static-libstdc++) if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows") target_link_libraries(GearSrc PRIVATE m) diff --git a/engine/tools/CMakeLists.txt b/engine/tools/CMakeLists.txt index 455658f..cb900e4 100644 --- a/engine/tools/CMakeLists.txt +++ b/engine/tools/CMakeLists.txt @@ -14,5 +14,4 @@ file(GLOB lz4_SRC ../lz4/*.c) compile_tool(gs_dumpfont) compile_tool(gs_makepak) -target_include_directories(gs_makepak PRIVATE ../lz4) -target_sources(gs_makepak PRIVATE ${lz4_SRC}) +target_link_libraries(gs_makepak PRIVATE lz4) diff --git a/external/lz4/CMakeLists.txt b/external/lz4/CMakeLists.txt new file mode 100644 index 0000000..70c52df --- /dev/null +++ b/external/lz4/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.11) +project(lz4) + +file(GLOB LZ4_SRC *.c) + +add_library(lz4 ${LZ4_SRC}) +target_include_directories(lz4 PUBLIC .) + +set_property(TARGET lz4 PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/engine/lz4/LICENSE b/external/lz4/LICENSE similarity index 100% rename from engine/lz4/LICENSE rename to external/lz4/LICENSE diff --git a/engine/lz4/lz4.c b/external/lz4/lz4.c similarity index 100% rename from engine/lz4/lz4.c rename to external/lz4/lz4.c diff --git a/engine/lz4/lz4.h b/external/lz4/lz4.h similarity index 100% rename from engine/lz4/lz4.h rename to external/lz4/lz4.h diff --git a/engine/lz4/lz4file.c b/external/lz4/lz4file.c similarity index 100% rename from engine/lz4/lz4file.c rename to external/lz4/lz4file.c diff --git a/engine/lz4/lz4file.h b/external/lz4/lz4file.h similarity index 100% rename from engine/lz4/lz4file.h rename to external/lz4/lz4file.h diff --git a/engine/lz4/lz4frame.c b/external/lz4/lz4frame.c similarity index 100% rename from engine/lz4/lz4frame.c rename to external/lz4/lz4frame.c diff --git a/engine/lz4/lz4frame.h b/external/lz4/lz4frame.h similarity index 100% rename from engine/lz4/lz4frame.h rename to external/lz4/lz4frame.h diff --git a/engine/lz4/lz4frame_static.h b/external/lz4/lz4frame_static.h similarity index 100% rename from engine/lz4/lz4frame_static.h rename to external/lz4/lz4frame_static.h diff --git a/engine/lz4/lz4hc.c b/external/lz4/lz4hc.c similarity index 100% rename from engine/lz4/lz4hc.c rename to external/lz4/lz4hc.c diff --git a/engine/lz4/lz4hc.h b/external/lz4/lz4hc.h similarity index 100% rename from engine/lz4/lz4hc.h rename to external/lz4/lz4hc.h diff --git a/engine/lz4/xxhash.c b/external/lz4/xxhash.c similarity index 100% rename from engine/lz4/xxhash.c rename to external/lz4/xxhash.c diff --git a/engine/lz4/xxhash.h b/external/lz4/xxhash.h similarity index 100% rename from engine/lz4/xxhash.h rename to external/lz4/xxhash.h