Compare commits

..

No commits in common. "449e777902afb1e29b8c16e4e0482ed794c6d2b2" and "9ede956d6cae4ab35eff2b5e0f88de3015ec72e5" have entirely different histories.

8 changed files with 22 additions and 33 deletions

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "vendor/raylib-cpp"] [submodule "vendor/raylib-cpp"]
path = vendor/raylib-cpp path = vendor/raylib-cpp
url = https://github.com/robloach/raylib-cpp url = https://github.com/robloach/raylib-cpp
[submodule "vendor/raylib"]
path = vendor/raylib
url = https://github.com/raysan5/raylib

View File

@ -1,9 +1,3 @@
# Copyright (c) 2020 Jonathan Moallem (@J-Mo63) & Aryeh Zinn (@Raelr)
#
# This code is released under an unmodified zlib license.
# For conditions of distribution and use, please see:
# https://opensource.org/licenses/Zlib
# Define custom functions # Define custom functions
rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
platformpth = $(subst /,$(PATHSEP),$1) platformpth = $(subst /,$(PATHSEP),$1)
@ -17,6 +11,9 @@ objects := $(patsubst src/%, $(buildDir)/%, $(patsubst %.cpp, %.o, $(sources)))
depends := $(patsubst %.o, %.d, $(objects)) depends := $(patsubst %.o, %.d, $(objects))
compileFlags := -std=c++17 -I include compileFlags := -std=c++17 -I include
linkFlags = -L lib/$(platform) -l raylib linkFlags = -L lib/$(platform) -l raylib
ifdef MACRO_DEFS
macroDefines := -D $(MACRO_DEFS)
endif
# Check for Windows # Check for Windows
ifeq ($(OS), Windows_NT) ifeq ($(OS), Windows_NT)
@ -71,15 +68,15 @@ submodules:
# Copy the relevant header files into includes # Copy the relevant header files into includes
include: submodules include: submodules
$(MKDIR) $(call platformpth, ./include) $(MKDIR) $(call platformpth, ./include)
$(call COPY,depends/raylib/src,./include,raylib.h) $(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raylib.h)
$(call COPY,depends/raylib/src,./include,raymath.h) $(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
$(call COPY,depends/raylib-cpp/include,./include,*.hpp) $(call COPY,vendor/raylib-cpp/include,./include,*.hpp)
# Build the raylib static library file and copy it into lib # Build the raylib static library file and copy it into lib
lib: submodules lib: submodules
cd depends/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
$(MKDIR) $(call platformpth, lib/$(platform)) $(MKDIR) $(call platformpth, lib/$(platform))
$(call COPY,depends/raylib/$(libGenDir),lib/$(platform),libraylib.a) $(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
# Link the program and create the executable # Link the program and create the executable
$(target): $(objects) $(target): $(objects)
@ -91,7 +88,7 @@ $(target): $(objects)
# Compile objects to the build directory # Compile objects to the build directory
$(buildDir)/%.o: src/%.cpp Makefile $(buildDir)/%.o: src/%.cpp Makefile
$(MKDIR) $(call platformpth, $(@D)) $(MKDIR) $(call platformpth, $(@D))
$(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(CXXFLAGS) $(CXX) -MMD -MP -c $(compileFlags) $< -o $@ $(macroDefines)
# Run the executable # Run the executable
execute: execute:

View File

@ -92,18 +92,18 @@ $ make ARGS="--somearg"
``` ```
### Specifying Custom Macro Definitions ### Specifying Custom Macro Definitions
You may also want to pass in your own macro definitions for certain configurations (such as setting log levels). You can pass in your definitions using `CXXFLAGS`: You may also want to pass in your own macro definitions for certain configurations (such as setting log levels). You can pass in your definitions using the `MACRO_DEFS` flag:
#### macOS & Linux #### macOS & Linux
```console ```console
$ make CXXFLAGS=-DMY_MACRO=1 $ make MACRO_DEFS=MY_MACRO
``` ```
#### Windows #### Windows
```console ```console
> mingw32-make CXXFLAGS=-DMY_MACRO=1 > mingw32-make MACRO_DEFS=MY_MACRO
``` ```
### Specifying a Non-Default Compiler ### Specifying a Non-Default Compiler
@ -127,9 +127,9 @@ $ make CXX=g++
It's pretty simple actually: It's pretty simple actually:
1. Fork it from [here](https://github.com/CapsCollective/raylib-cpp-starter/fork) 1. Fork it from [here](https://github.com/CapsCollective/raylib-cpp-starter/fork)
2. Create your feature branch (`git checkout -b cool-new-feature`) 2. Create your feature branch (git checkout -b cool-new-feature)
3. Commit your changes (`git commit -m "Added some feature"`) 3. Commit your changes (git commit -m "Added some feature")
4. Push to the branch (`git push origin cool-new-feature`) 4. Push to the branch (git push origin cool-new-feature)
5. Create a new pull request for it! 5. Create a new pull request for it!
### Contributors ### Contributors
@ -137,8 +137,6 @@ It's pretty simple actually:
- [Raelr](https://github.com/Raelr) Aryeh Zinn - co-creator, maintainer - [Raelr](https://github.com/Raelr) Aryeh Zinn - co-creator, maintainer
- [mTvare6](https://github.com/mTvare6) mTvare6 - contributor - [mTvare6](https://github.com/mTvare6) mTvare6 - contributor
- [rafaeldelboni](https://github.com/rafaeldelboni) Rafael Delboni - contributor - [rafaeldelboni](https://github.com/rafaeldelboni) Rafael Delboni - contributor
- [jason-cannon](https://github.com/jason-cannon) Jason Cannon - contributor
- [return215](https://github.com/return215) Muhammad Hidayat - contributor
## Licence ## Licence

@ -1 +0,0 @@
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64

@ -1 +0,0 @@
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef

View File

@ -111,7 +111,7 @@ include: submodules
... ...
``` ```
`submodules` is a very simple target that will update the git submodules in the project recursively, pulling in the current raylib and raylib-cpp repositories. You can [read more about git submodules here](https://git-scm.com/book/en/v2/Git-Tools-Submodules). `submodules` is a very simple target that will update the git submodules in the project recursively, pulling in the current raylib-cpp repository under the `/vendor` directory and then raylib itself under its own `/vendor` directory. The reason for this, is to make sure that the pulled versions of raylib and the bindings match in version. You can [read more about git submodules here](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
```Makefile ```Makefile
submodules: submodules:
git submodule update --init --recursive git submodule update --init --recursive
@ -125,8 +125,8 @@ Next, the target proceeds to call another custom function, `COPY` (a platform ag
```Makefile ```Makefile
include: submodules include: submodules
$(MKDIR) $(call platformpth, ./include) $(MKDIR) $(call platformpth, ./include)
$(call COPY,vendor/raylib/src,./include,raylib.h) $(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raylib.h)
$(call COPY,vendor/raylib/src,./include,raymath.h) $(call COPY,vendor/raylib-cpp/vendor/raylib/src,./include,raymath.h)
$(call COPY,vendor/raylib-cpp/include,./include,*.hpp) $(call COPY,vendor/raylib-cpp/include,./include,*.hpp)
``` ```
@ -139,9 +139,9 @@ Moving on to the body of the target, we move into raylib's `/src` directory and
To complete the target, it then copies that library file into the relevant directory for your platform under `/lib`. To complete the target, it then copies that library file into the relevant directory for your platform under `/lib`.
```Makefile ```Makefile
lib: submodules lib: submodules
cd vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP cd vendor/raylib-cpp/vendor/raylib/src $(THEN) "$(MAKE)" PLATFORM=PLATFORM_DESKTOP
$(MKDIR) $(call platformpth, lib/$(platform)) $(MKDIR) $(call platformpth, lib/$(platform))
$(call COPY,vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a) $(call COPY,vendor/raylib-cpp/vendor/raylib/$(libGenDir),lib/$(platform),libraylib.a)
``` ```
Once all of these targets have been fulfilled, `setup` ends and your project should now contain a copy of the relevant static library for your platform in `/lib`, and all the necessary header files under `/include`. Once all of these targets have been fulfilled, `setup` ends and your project should now contain a copy of the relevant static library for your platform in `/lib`, and all the necessary header files under `/include`.

1
vendor/raylib vendored

@ -1 +0,0 @@
Subproject commit 0851960397f02a477d80eda2239f90fae14dec64

2
vendor/raylib-cpp vendored

@ -1 +1 @@
Subproject commit a8f803edae6db67dafa1f84c1099f1bbc74925ef Subproject commit 725379892203da857593547e93fc30044e239ab6