Skip to content

Commit

Permalink
Optional Clang build
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jul 22, 2024
1 parent 31ca673 commit 72599fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
11 changes: 7 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ ENV LANG="C.UTF-8"
RUN apt-get update \
&& apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
vim \
make \
cmake \
unzip \
zip \
xxd \
build-essential \
gdb \
clang \
lldb \
libsdl2-dev \
libglew-dev \
libgtk-3-dev \
gdb \
vim \
cmake \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get autoremove -y && apt-get clean -y

# Default to bash shell (other shells available at /usr/bin/fish and /usr/bin/zsh)
# Default to zsh shell
ENV SHELL=/usr/bin/zsh \
DOCKER_BUILDKIT=1

Expand Down
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"GitHub.vscode-pull-request-github",
"ms-vscode.cpptools",
"github.vscode-github-actions",
"GitHub.copilot",
"GitHub.copilot-chat",
"ms-vscode.makefile-tools"
"ms-vscode.cpptools-extension-pack",
"ms-vscode.hexeditor"
]
}
}
Expand Down
14 changes: 9 additions & 5 deletions platforms/shared/desktop/makefiles/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ define HEADER
endef
export HEADER

CXX = g++
CC = gcc
#CXX = clang++
#CC = clang

TARGET_NAME = geargrafx
GIT_VERSION := "$(shell git describe --abbrev=7 --dirty --always --tags)"
UNAME_S := $(shell uname -s)
PLATFORM = "undefined"

OBJECTS += $(SOURCES_C:.c=.o) $(SOURCES_CXX:.cpp=.o)

USE_CLANG ?= 0
ifeq ($(USE_CLANG), 1)
CXX = clang++
CC = clang
else
CXX = g++
CC = gcc
endif

CPPFLAGS += -I../ -I../../
CPPFLAGS += -Wall -Wextra -Wformat -DEMULATOR_BUILD=\"$(GIT_VERSION)\"
CXXFLAGS += -std=c++11
Expand Down

0 comments on commit 72599fd

Please sign in to comment.