Move source files to utils

This commit is contained in:
zontreck 2024-07-30 16:33:29 -07:00
parent 89f614e6f3
commit 43e16ce945
6 changed files with 11 additions and 16 deletions

4
.gitignore vendored
View file

@ -1 +1,3 @@
build
build
*.o
*.so

View file

@ -8,10 +8,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Add source files
file(GLOB SOURCES "src/*.cpp")
file(GLOB SOURCES "src/utils/*.cpp" "src/nbt/*.cpp")
# Add an executable target
add_executable(ac ${SOURCES})
# Add an shared library target
add_library(ac SHARED ${SOURCES})
# Optionally, if you have any additional include directories or libraries, add them here:
# target_include_directories(ac PRIVATE ${CMAKE_SOURCE_DIR}/include)

View file

@ -3,22 +3,16 @@ CXX = g++
CXXFLAGS = -std=c++17 -Wall -Wextra
# Source files and target executable
SRCS = $(wildcard src/*.cpp)
OBJS = $(SRCS:.cpp=.o)
TARGET = ac
# Build target
all: $(TARGET)
all: clean build
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $(OBJS)
# Build object files
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
build:
mkdir build
cd build && cmake .. && make && mv libac.so ..
# Clean up build artifacts
clean:
rm -f $(TARGET) $(OBJS)
rm -rf build
.PHONY: all clean

View file

@ -1 +0,0 @@
add_library(ac SHARED Progress.cpp Progress.h)