Move source files to utils
This commit is contained in:
parent
89f614e6f3
commit
43e16ce945
6 changed files with 11 additions and 16 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1 +1,3 @@
|
||||||
build
|
build
|
||||||
|
*.o
|
||||||
|
*.so
|
|
@ -8,10 +8,10 @@ set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
|
|
||||||
# Add source files
|
# Add source files
|
||||||
file(GLOB SOURCES "src/*.cpp")
|
file(GLOB SOURCES "src/utils/*.cpp" "src/nbt/*.cpp")
|
||||||
|
|
||||||
# Add an executable target
|
# Add an shared library target
|
||||||
add_executable(ac ${SOURCES})
|
add_library(ac SHARED ${SOURCES})
|
||||||
|
|
||||||
# Optionally, if you have any additional include directories or libraries, add them here:
|
# Optionally, if you have any additional include directories or libraries, add them here:
|
||||||
# target_include_directories(ac PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
# target_include_directories(ac PRIVATE ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -3,22 +3,16 @@ CXX = g++
|
||||||
CXXFLAGS = -std=c++17 -Wall -Wextra
|
CXXFLAGS = -std=c++17 -Wall -Wextra
|
||||||
|
|
||||||
# Source files and target executable
|
# Source files and target executable
|
||||||
SRCS = $(wildcard src/*.cpp)
|
|
||||||
OBJS = $(SRCS:.cpp=.o)
|
|
||||||
TARGET = ac
|
|
||||||
|
|
||||||
# Build target
|
# Build target
|
||||||
all: $(TARGET)
|
all: clean build
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
build:
|
||||||
$(CXX) $(CXXFLAGS) -o $@ $(OBJS)
|
mkdir build
|
||||||
|
cd build && cmake .. && make && mv libac.so ..
|
||||||
# Build object files
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
# Clean up build artifacts
|
# Clean up build artifacts
|
||||||
clean:
|
clean:
|
||||||
rm -f $(TARGET) $(OBJS)
|
rm -rf build
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
add_library(ac SHARED Progress.cpp Progress.h)
|
|
Loading…
Reference in a new issue