Browse Source

Added initial setup

SDLAttempt
Macoy Madson 1 year ago
parent
commit
b87a047c66
  1. 5
      .gitignore
  2. 3
      .gitmodules
  3. 5
      BuildDependencies_Debug.sh
  4. 6
      Build_Debug.sh
  5. 1
      Dependencies/cakelisp
  6. 3
      Jamfile
  7. 102
      Jamrules
  8. 3
      src/Jamfile
  9. 5
      src/OgreCore.cake
  10. 3
      test/Jamfile
  11. 105
      test/Jamrules
  12. 9
      test/OgreApp.cake

5
.gitignore

@ -32,3 +32,8 @@
*.out
*.app
*.cake.*
cakelisp_cache/
bin/
lib/

3
.gitmodules

@ -0,0 +1,3 @@
[submodule "Dependencies/cakelisp"]
path = Dependencies/cakelisp
url = https://macoy.me/code/macoy/cakelisp

5
BuildDependencies_Debug.sh

@ -0,0 +1,5 @@
#!/bin/sh
echo "Building Cakelisp..."
cd Dependencies/cakelisp && jam -j4 && cd ../../
echo "done!"

6
Build_Debug.sh

@ -0,0 +1,6 @@
#!/bin/sh
./Dependencies/cakelisp/bin/cakelisp src/OgreCore.cake \
&& jam -j4 libGameLib.a
./Dependencies/cakelisp/bin/cakelisp test/OgreApp.cake && cd test && jam -j4

1
Dependencies/cakelisp

@ -0,0 +1 @@
Subproject commit 59b5e0e5aa3bda8ecea90060673a3fbaad01a7b4

3
Jamfile

@ -0,0 +1,3 @@
SubDir . ;
SubInclude . src ;

102
Jamrules

@ -0,0 +1,102 @@
##
## Compilation
##
C++ = clang++ ;
LINK = clang++ ;
# C++ = g++ ;
# LINK = g++ ;
if $(UNIX) { SUFSHR = .so ; }
else if $(NT) { SUFSHR = .dll ; }
if $(CROSS_COMPILE_WINDOWS)
{
C++ = x86_64-w64-mingw32-g++ ;
LINK = x86_64-w64-mingw32-g++ ;
AR = x86_64-w64-mingw32-ar ;
SUFEXE = .exe ;
OS_DEPENDENT_C++FLAGS = -DWINDOWS ;
OS_DEPENDENT_LINKLIBS = ;
OS_DEPENDENT_LINKFLAGS = --export-all-symbols ;
MINGW_LIB_PATH = /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 ;
OS_DEPENDENT_DLLS =
$(MINGW_LIB_PATH)/libgcc_s_seh-1.dll
$(MINGW_LIB_PATH)/libstdc++-6.dll ;
}
else if $(UNIX)
{
OS_DEPENDENT_C++FLAGS = -DUNIX ;
# For dynamic loading: ldl loads, export-dynamic lets the loaded code resolve its symbols to the loader's code
OS_DEPENDENT_LINKLIBS = -ldl ;
OS_DEPENDENT_LINKFLAGS = --export-dynamic ;
OS_DEPENDENT_DLLS = ;
}
else if $(NT)
{
OS_DEPENDENT_C++FLAGS = -DWINDOWS ;
# TODO: Windows support
OS_DEPENDENT_LINKLIBS = ;
OS_DEPENDENT_LINKFLAGS = ;
OS_DEPENDENT_DLLS = ;
}
# Arguments used on all projects, regardless of any variables
C++FLAGS = -std=c++11 -Wall -Wextra -Wno-unused-parameter
# Only for profiling, i.e. not release builds
# -DTRACY_ENABLE
-g
# Needed for dynamic linking
-fPIC
$(OS_DEPENDENT_C++FLAGS)
;
# TODO: Make base hold all this weirdness?
# if $(DEBUG_BUILD)
# {
# SFML_LINKLIBS = -lsfml-audio-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d ;
# }
# else
# {
# SFML_LINKLIBS = -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system ;
# }
OPTIM = -O0 ;
##
## Linking
##
LINKLIBS =
# Standard (e.g. for Tracy)
-lpthread
# Functions for dynamically loading libraries (UNIX)
$(OS_DEPENDENT_LINKLIBS)
;
LINKFLAGS = -g
# -Wl = pass to linker
# --export-dynamic = Export all symbols so dynamically loaded code can resolve their symbols to ours
-Wl,-rpath,.,$(OS_DEPENDENT_LINKFLAGS)
;
##
## Jam stuff
##
# Fix for unnecessary rebuilding any Jam project
KEEPOBJS = true ; # This doesn't actually fix anything, though it seems like it should
NOARSCAN = true ; # This actually fixes the problem
#AR = ar rUu ; # I was thinking maybe the AR command was wrong (always outputting deterministically)
# It doesn't seem like this is the problem though
AR = ar cr ;
# Some helpful Jam commands
# -q : stop on failed target
# -jN : use N cores
# -sVAR=VAL : Set VAR to VAL. Note that setting WINDOWS=false is the same as setting WINDOWS=true,
# frustratingly (as if it's an ifdef not an if x = y
# -dx : print commands being used
# -n : don't actually run commands

3
src/Jamfile

@ -0,0 +1,3 @@
SubDir . src ;
Library libGameLib : OgreCore.cake.cpp ;

5
src/OgreCore.cake

@ -0,0 +1,5 @@
(c-import "<stdio.h>")
(defun ogre-initialize (&return bool)
(printf "Ogre initialized\n")
(return true))

3
test/Jamfile

@ -0,0 +1,3 @@
SubDir . ;
Main ogreApp : OgreApp.cake.cpp ;

105
test/Jamrules

@ -0,0 +1,105 @@
##
## Compilation
##
C++ = clang++ ;
LINK = clang++ ;
# C++ = g++ ;
# LINK = g++ ;
if $(UNIX) { SUFSHR = .so ; }
else if $(NT) { SUFSHR = .dll ; }
if $(CROSS_COMPILE_WINDOWS)
{
C++ = x86_64-w64-mingw32-g++ ;
LINK = x86_64-w64-mingw32-g++ ;
AR = x86_64-w64-mingw32-ar ;
SUFEXE = .exe ;
OS_DEPENDENT_C++FLAGS = -DWINDOWS ;
OS_DEPENDENT_LINKLIBS = ;
OS_DEPENDENT_LINKFLAGS = --export-all-symbols ;
MINGW_LIB_PATH = /usr/lib/gcc/x86_64-w64-mingw32/7.3-win32 ;
OS_DEPENDENT_DLLS =
$(MINGW_LIB_PATH)/libgcc_s_seh-1.dll
$(MINGW_LIB_PATH)/libstdc++-6.dll ;
}
else if $(UNIX)
{
OS_DEPENDENT_C++FLAGS = -DUNIX ;
# For dynamic loading: ldl loads, export-dynamic lets the loaded code resolve its symbols to the loader's code
OS_DEPENDENT_LINKLIBS = -ldl ;
OS_DEPENDENT_LINKFLAGS = --export-dynamic ;
OS_DEPENDENT_DLLS = ;
}
else if $(NT)
{
OS_DEPENDENT_C++FLAGS = -DWINDOWS ;
# TODO: Windows support
OS_DEPENDENT_LINKLIBS = ;
OS_DEPENDENT_LINKFLAGS = ;
OS_DEPENDENT_DLLS = ;
}
# Arguments used on all projects, regardless of any variables
C++FLAGS = -std=c++11 -Wall -Wextra -Wno-unused-parameter
# Only for profiling, i.e. not release builds
# -DTRACY_ENABLE
-g
# Needed for dynamic linking
-fPIC
$(OS_DEPENDENT_C++FLAGS)
;
# TODO: Make base hold all this weirdness?
# if $(DEBUG_BUILD)
# {
# SFML_LINKLIBS = -lsfml-audio-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d ;
# }
# else
# {
# SFML_LINKLIBS = -lsfml-audio -lsfml-graphics -lsfml-window -lsfml-system ;
# }
OPTIM = -O0 ;
##
## Linking
##
LINKLIBS =
# Standard (e.g. for Tracy)
-lpthread
# Functions for dynamically loading libraries (UNIX)
$(OS_DEPENDENT_LINKLIBS)
-L../src
-lGameLib
;
LINKFLAGS = -g
# -Wl = pass to linker
# --export-dynamic = Export all symbols so dynamically loaded code can resolve their symbols to ours
-Wl,-rpath,.,$(OS_DEPENDENT_LINKFLAGS)
;
##
## Jam stuff
##
# Fix for unnecessary rebuilding any Jam project
KEEPOBJS = true ; # This doesn't actually fix anything, though it seems like it should
NOARSCAN = true ; # This actually fixes the problem
#AR = ar rUu ; # I was thinking maybe the AR command was wrong (always outputting deterministically)
# It doesn't seem like this is the problem though
AR = ar cr ;
# Some helpful Jam commands
# -q : stop on failed target
# -jN : use N cores
# -sVAR=VAL : Set VAR to VAL. Note that setting WINDOWS=false is the same as setting WINDOWS=true,
# frustratingly (as if it's an ifdef not an if x = y
# -dx : print commands being used
# -n : don't actually run commands

9
test/OgreApp.cake

@ -0,0 +1,9 @@
;; TODO: Cakelisp include paths
(import "../src/OgreCore.cake")
(c-import "<stdio.h>")
(defun main (&return int)
(printf "Hello, world!\n")
(ogre-initialize)
(return 0))
Loading…
Cancel
Save