Skip to content

Instantly share code, notes, and snippets.

@refi64
Created February 12, 2015 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save refi64/549151151b4a440c48b2 to your computer and use it in GitHub Desktop.
Save refi64/549151151b4a440c48b2 to your computer and use it in GitHub Desktop.
AsmJit build system with Boost.Build
import option ;
import package ;
import regex ;
local embed = [ option.get embed : 0 ] ;
local xprops = ;
if embed in 1 true yes {
xprops = "<link>static" ;
}
project asmjit
: requirements <include>src $(xprops)
<toolset>msvc:<linkflags>"/OPT:REF /OPT:ICF"
<toolset>msvc:<cflags>"/GF"
<toolset>msvc:<variant>debug:<cflags>"/GS"
<toolset>msvc:<variant>release:<cflags>"/Oi /Oy /GS-"
<toolset>msvc:<rtti>:off
<toolset>gcc:<exception-handling>off
<toolset>gcc:<variant>debug:<optimization>off
<toolset>gcc:<inlining>full
<toolset>gcc:<cflags>"-fomit-frame-pointer -fmerge-all-constants -fno-keep-static-consts"
<toolset>gcc:<exception-handling>off
<toolset>clang:<variant>debug:<optimization>off
<toolset>clang:<cflags>"-fcolor-diagnostics -fomit-frame-pointer -fmerge-all-constants"
<variant>debug:<define>ASMJIT_DEBUG
<variant>release:<define>ASMJIT_RELEASE
<link>static:<define>ASMJIT_STATIC
<threading>multi
: usage-requirements <include>src
;
local dirs = asmjit asmjit/base asmjit/x86 ;
local srcs = ;
local headers = ;
for local d in $(dirs) {
srcs += [ glob src/$(d)/*.cpp ] ;
headers += [ glob src/$(d)/*.h ] ;
}
if ! ( embed in 1 true yes ) {
lib asmjit : $(srcs) ;
exe asmjit_test : $(srcs) [ glob src/asmjit/test/*.cpp ] ;
local apps = asmjit_bench_x86 asmjit_test_opcode asmjit_test_x86 ;
for local app in $(apps) {
exe $(app) : src/app/test/$(app).cpp asmjit ;
}
install bin : asmjit asmjit_test $(apps) ;
package.install install : <install-source-root>src : : asmjit : $(headers) ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment