Browse Source

Fixed Jam Library rebuilding

Fixed is a strong word - I hacked around a strange problem I was encountering where Jam would always fail to scan libraries for object dependencies. This would result in library rebuilds every time Jam was run, which is super shitty. 
Now, jam will leave the .o files alongside the .a files so it doesn't have to scan the archive. This isn't a true fix, but it gets the job done. 
Building when you've only changed a few files is now massively faster. I also found out how to enable parallel compiliation, so even full rebuilds are much quicker ('jam -j4').
combatComponentRefactor
Macoy Madson 7 years ago
parent
commit
3cc4617f0d
  1. 29
      Jamrules
  2. 2
      README.md

29
Jamrules

@ -1,4 +1,3 @@
##
## Compiler
##
@ -28,9 +27,31 @@ LINK = clang++ ;
#C++FLAGS = -std=c++11 -stdlib=libc++ -fPIC -g -Og -Wall -Wextra ; # Required arguments for Unreal
C++FLAGS = -std=c++11 -fPIC -g -Og -Wall -Wextra ; # Required arguments for tests
OBJECTC++FLAGS = -std=c++11 -lstdc++ -g -Og ;
HDRS = thirdParty/flatbuffers/include ;
# TODO: add project-specific filetype rules for things like flatbuffer .json compilation (see "UserObject rule":
# https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jamfile.html ) ?
# https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jamfile.html ) ?
# TODO: Add variable that allows user to swap between compiling Unreal
# and compiling testse on the command line (see above page under "Variables
# used in Building Executables and Libraries)
# TODO: [Hacked done] Calling jam -dc indicates that it thinks many unmodified files are newer,
# which is why it's building way more than it should be. Further investigation is needed, as if it
# has nothing to build it should complete almost instantly
#
# The problem was Library deletes .o files, preventing Jam from knowing what needs rebuilt
# (see https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jambase.html)
# Actually, because I'm moving libs to lib/, Jam doesn't know to look there for .o
# (see http://maillist.perforce.com/pipermail/jamming/2004-November/004235.html)
# Motherfucker seems to be broken no matter fucking what (see src/Jamfile commented lines)
#
# Update: Something seems fucked with the Library or LibraryFromObjects rules. Instead of diving
# deeper, I'm going to just add this flag which will guarantee Jam won't rely on reading the libs
# to find "missing" objects
# (as an aside, https://swarm.workshop.perforce.com/view/guest/perforce_software/jam/src/Jam.html
# was helpful, esp 'jam -dx')
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

2
README.md

@ -22,6 +22,8 @@ To build with jam, first install jam:
`sudo apt-get install jam`
Then run jam (in galavant/ is fine):
`jam`
For vastly faster build times, add `-j` plus the number of CPU cores on your machine, e.g.:
`jam -j4`
## Dependencies

Loading…
Cancel
Save