Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton3 committed Dec 12, 2023
1 parent 9555444 commit a9a9dfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ compile_commands.json
cmake-build-*
Testing/
.DS_Store
CmakeUserPresets.json
Makefile.local
15 changes: 9 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
CMAKE_OPTIONS ?=
CMAKE_COMMON_FLAGS ?= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
CMAKE_DEBUG_FLAGS ?= -DUSERVER_SANITIZE='addr ub'
CMAKE_DEBUG_FLAGS ?= -DUSERVER_SANITIZE='addr;ub'
CMAKE_RELEASE_FLAGS ?=
NPROCS ?= $(shell nproc)
CLANG_FORMAT ?= clang-format
DOCKER_COMPOSE ?= docker-compose

# NOTE: use Makefile.local for customization
# NOTE: use Makefile.local to override the options defined above.
-include Makefile.local

CMAKE_COMMON_FLAGS += $(CMAKE_OPTIONS)
CMAKE_DEBUG_FLAGS += -DCMAKE_BUILD_TYPE=Debug
CMAKE_RELEASE_FLAGS += -DCMAKE_BUILD_TYPE=Release

.PHONY: all
all: test-debug test-release

# Debug cmake configuration
build_debug/Makefile:
@git submodule update --init
@mkdir -p build_debug
@cd build_debug && \
cmake -DCMAKE_BUILD_TYPE=Debug $(CMAKE_COMMON_FLAGS) $(CMAKE_DEBUG_FLAGS) $(CMAKE_OS_FLAGS) $(CMAKE_OPTIONS) ..
@cmake -B build_debug $(CMAKE_COMMON_FLAGS) $(CMAKE_DEBUG_FLAGS) $(CMAKE_OPTIONS)

# Release cmake configuration
build_release/Makefile:
@git submodule update --init
@mkdir -p build_release
@cd build_release && \
cmake -DCMAKE_BUILD_TYPE=Release $(CMAKE_COMMON_FLAGS) $(CMAKE_RELEASE_FLAGS) $(CMAKE_OS_FLAGS) $(CMAKE_OPTIONS) ..
@cmake -B build_release $(CMAKE_COMMON_FLAGS) $(CMAKE_RELEASE_FLAGS) $(CMAKE_OPTIONS)

# Run cmake
.PHONY: cmake-debug cmake-release
Expand Down

0 comments on commit a9a9dfd

Please sign in to comment.