Skip to content

Instantly share code, notes, and snippets.

@mtwilliams
Created October 31, 2015 21:27
Show Gist options
  • Save mtwilliams/d7c10c6ecc740dc8568b to your computer and use it in GitHub Desktop.
Save mtwilliams/d7c10c6ecc740dc8568b to your computer and use it in GitHub Desktop.
project :yeti, pretty: 'Yeti' do |proj|
# Statically link to Yeti for the (small) optimization wins.
proj.define 'YETI_LINKAGE' => 'YETI_LINKAGE_STATIC'
# Supress all of Visual Studio's bullshit.
# TODO(mtwilliams): Refactor into Ryb.
proj.define '_HAS_EXCEPTIONS' => false,
'_SCL_SECURE_NO_WARNINGS' => true,
'_CRT_SECURE_NO_WARNINGS' => true,
'_CRT_SECURE_NO_DEPRECATE' => true,
'_SECURE_SCL_THROWS' => false,
'_SILENCE_DEPRECATION_OF_SECURE_SCL_THROWS' => true,
# See http://stackoverflow.com/questions/14363929
'_USING_V110_SDK71_' => true
# Suffix builds in the form: _{configuration}_{platform}_{32,64}.
# e.g. level_editor_debug_macosx_64.app or level_editor_windows_32.exe
proj.architecture :x86 do |arch| arch.suffix = '_32'; end
proj.architecture :x86_64 do |arch| arch.suffix = '_64'; end
proj.platform :windows do |platform| platform.suffix = '_windows'; end
proj.platform :macosx do |platform| platform.suffix = '_macosx'; end
proj.platform :linux do |platform| platform.suffix = '_linux'; end
proj.configuration 'debug' do |config| config.suffix = '_debug'; end
proj.configuration 'development' do |config| config.suffix = '_development'; end
proj.configuration 'release' do |config| config.suffix = '_release'; end
# We target Windows 7 and later.
proj.platform :windows do |platform| platform.sdk = '7.1'; end
# We target Lion and later.
proj.platform :macosx do |platform| platform.version = '10.7'; end
# TODO(mtwilliams): Determine the minimum kernel we'll support.
proj.platform :linux do |platform| end
proj.configuration :debug, pretty: 'Debug' do
config.define 'YETI_CONFIGURATION' => 'YETI_CONFIGURATION_DEBUG'
config.define '_DEBUG' => true,
'_HAS_ITERATOR_DEBUGGING' => true,
'_SECURE_SCL' => true
config.generate_debug_symbols = true
config.link_time_code_generation = false
config.optimize = :none
end
proj.configuration :development, pretty: 'Development' do
config.define 'YETI_CONFIGURATION' => 'YETI_CONFIGURATION_DEBUG'
config.define 'NDEBUG' => true,
'_HAS_ITERATOR_DEBUGGING' => false,
'_SECURE_SCL' => false
config.generate_debug_symbols = true
config.link_time_code_generation = false
config.optimize = :speed
end
proj.configuration :release, pretty: 'Release' do |config|
config.define 'YETI_CONFIGURATION' => 'YETI_CONFIGURATION_DEBUG'
config.define 'NDEBUG' => true,
'_HAS_ITERATOR_DEBUGGING' => false,
'_SECURE_SCL' => false
config.generate_debug_symbols = true
config.link_time_code_generation = true
config.optimize = :speed
end
proj.library :yeti, pretty: 'Yeti' do |lib|
lib.define '__YETI_IS_BEING_COMPILED__' => true
lib.linkage = :static
lib.add_includes_paths 'include/'
lib.add_libraries_paths '$BUILT/lib/', '$BUILT/bin/'
lib.add_binaries_paths '$BUILT/bin/'
lib.add_source_files 'include/**/*.{h,hpp,inl}'
lib.add_source_files 'src/**/*.{c,cc,cpp}'
end
proj.application :runtime, pretty: 'Runtime' do |app|
app.add_include_paths 'include/', 'runtime/include/'
app.add_library_paths '$BUILT/lib/', '$BUILT/bin/'
app.add_binary_paths '$BUILT/bin/'
app.add_source_files 'runtime/include/**/*.{h,hpp,inl}'
app.add_source_files 'runtime/src/**/*.{c,cc,cpp}'
app.add_dependency :yeti
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment