|
@@ -100,6 +100,7 @@ task :make do
|
|
|
cmake_build_options = ''
|
|
cmake_build_options = ''
|
|
|
build_options = ''
|
|
build_options = ''
|
|
|
unfilter = false
|
|
unfilter = false
|
|
|
|
|
+ ['config', 'target', 'sdk'].each { |var| ARGV << "#{var}=\"#{ENV[var]}\"" if ENV[var] and !ARGV.include? var }
|
|
|
ARGV.each { |option|
|
|
ARGV.each { |option|
|
|
|
task option.to_sym do ; end; Rake::Task[option].clear # No-op hack
|
|
task option.to_sym do ; end; Rake::Task[option].clear # No-op hack
|
|
|
case option
|
|
case option
|
|
@@ -507,12 +508,8 @@ end
|
|
|
|
|
|
|
|
def scaffolding dir, project = 'Scaffolding', target = 'Main'
|
|
def scaffolding dir, project = 'Scaffolding', target = 'Main'
|
|
|
build_script = <<EOF
|
|
build_script = <<EOF
|
|
|
-# Set project name
|
|
|
|
|
-project (#{project})
|
|
|
|
|
-
|
|
|
|
|
-# Set minimum version
|
|
|
|
|
|
|
+# Set CMake minimum version and CMake policy required by Urho3D-CMake-common module
|
|
|
cmake_minimum_required (VERSION 2.8.6)
|
|
cmake_minimum_required (VERSION 2.8.6)
|
|
|
-
|
|
|
|
|
if (COMMAND cmake_policy)
|
|
if (COMMAND cmake_policy)
|
|
|
cmake_policy (SET CMP0003 NEW)
|
|
cmake_policy (SET CMP0003 NEW)
|
|
|
if (CMAKE_VERSION VERSION_GREATER 2.8.12 OR CMAKE_VERSION VERSION_EQUAL 2.8.12)
|
|
if (CMAKE_VERSION VERSION_GREATER 2.8.12 OR CMAKE_VERSION VERSION_EQUAL 2.8.12)
|
|
@@ -527,6 +524,9 @@ if (COMMAND cmake_policy)
|
|
|
endif ()
|
|
endif ()
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
+# Set project name
|
|
|
|
|
+project (#{project})
|
|
|
|
|
+
|
|
|
# Set CMake modules search path
|
|
# Set CMake modules search path
|
|
|
set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
|
|
set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
|
|
|
|
|
|
|
@@ -586,13 +586,13 @@ def makefile_ci
|
|
|
unless ENV['CI'] && ENV['HTML5'] && ENV['PACKAGE_UPLOAD'] # For Emscripten, skip scaffolding test when packaging
|
|
unless ENV['CI'] && ENV['HTML5'] && ENV['PACKAGE_UPLOAD'] # For Emscripten, skip scaffolding test when packaging
|
|
|
# Create a new project on the fly that uses newly built Urho3D library in the build tree
|
|
# Create a new project on the fly that uses newly built Urho3D library in the build tree
|
|
|
scaffolding "../Build/generated/UsingBuildTree"
|
|
scaffolding "../Build/generated/UsingBuildTree"
|
|
|
- system "cd ../Build/generated/UsingBuildTree && echo '\nDownstream project referencing Urho3D library in its build tree' && ./cmake_generic.sh . #{$build_options} -DURHO3D_HOME=../.. -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && make -j$NUMJOBS #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
|
|
|
|
|
|
|
+ system "cd ../Build/generated/UsingBuildTree && echo '\nConfiguring downstream project using Urho3D library in its build tree...' && ./cmake_generic.sh . #{$build_options} -DURHO3D_HOME=../.. -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && make -j$NUMJOBS #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
|
|
|
ENV['DESTDIR'] = ENV['HOME'] || Dir.home
|
|
ENV['DESTDIR'] = ENV['HOME'] || Dir.home
|
|
|
puts "\nInstalling Urho3D SDK to #{ENV['DESTDIR']}/usr/local...\n" # The default CMAKE_INSTALL_PREFIX is /usr/local
|
|
puts "\nInstalling Urho3D SDK to #{ENV['DESTDIR']}/usr/local...\n" # The default CMAKE_INSTALL_PREFIX is /usr/local
|
|
|
system 'cd ../Build && make -j$NUMJOBS install >/dev/null' or abort 'Failed to install Urho3D SDK'
|
|
system 'cd ../Build && make -j$NUMJOBS install >/dev/null' or abort 'Failed to install Urho3D SDK'
|
|
|
# Create a new project on the fly that uses newly installed Urho3D SDK
|
|
# Create a new project on the fly that uses newly installed Urho3D SDK
|
|
|
scaffolding "../Build/generated/UsingSDK"
|
|
scaffolding "../Build/generated/UsingSDK"
|
|
|
- system "export URHO3D_HOME=~/usr/local && cd ../Build/generated/UsingSDK && echo '\nDownstream project referencing Urho3D SDK' && ./cmake_generic.sh . #{$build_options} -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && make -j$NUMJOBS #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
|
|
|
|
|
|
|
+ system "export URHO3D_HOME=~/usr/local && cd ../Build/generated/UsingSDK && echo '\nConfiguring downstream project using Urho3D SDK...' && ./cmake_generic.sh . #{$build_options} -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing} -DCMAKE_BUILD_TYPE=#{$configuration} && make -j$NUMJOBS #{test}" or abort 'Failed to configure/build/test temporary downstream project using Urho3D as external library'
|
|
|
end
|
|
end
|
|
|
# Make, deploy, and test run Android APK in an Android (virtual) device
|
|
# Make, deploy, and test run Android APK in an Android (virtual) device
|
|
|
if ENV['AVD'] && !ENV['PACKAGE_UPLOAD']
|
|
if ENV['AVD'] && !ENV['PACKAGE_UPLOAD']
|
|
@@ -733,13 +733,13 @@ def xcode_ci
|
|
|
unless ENV['CI'] && ENV['IOS'] && ENV['PACKAGE_UPLOAD'] # Skip scaffolding test when packaging for iOS
|
|
unless ENV['CI'] && ENV['IOS'] && ENV['PACKAGE_UPLOAD'] # Skip scaffolding test when packaging for iOS
|
|
|
# Create a new project on the fly that uses newly built Urho3D library in the build tree
|
|
# Create a new project on the fly that uses newly built Urho3D library in the build tree
|
|
|
scaffolding "../Build/generated/UsingBuildTree"
|
|
scaffolding "../Build/generated/UsingBuildTree"
|
|
|
- system "cd ../Build/generated/UsingBuildTree && echo '\nDownstream project referencing Urho3D library in its build tree' && ./cmake_macosx.sh . -DIOS=$IOS #{$build_options} -DURHO3D_HOME=../.. -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure temporary project using Urho3D as external library'
|
|
|
|
|
|
|
+ system "cd ../Build/generated/UsingBuildTree && echo '\nConfiguring downstream project using Urho3D library in its build tree...' && ./cmake_macosx.sh . -DIOS=$IOS #{$build_options} -DURHO3D_HOME=../.. -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure temporary project using Urho3D as external library'
|
|
|
xcode_build(ENV['IOS'], '../Build/generated/UsingBuildTree/Scaffolding.xcodeproj') or abort 'Failed to build/test temporary downstream project using Urho3D as external library'
|
|
xcode_build(ENV['IOS'], '../Build/generated/UsingBuildTree/Scaffolding.xcodeproj') or abort 'Failed to build/test temporary downstream project using Urho3D as external library'
|
|
|
ENV['DESTDIR'] = ENV['HOME'] || Dir.home
|
|
ENV['DESTDIR'] = ENV['HOME'] || Dir.home
|
|
|
wait_for_block("\nInstalling Urho3D SDK to #{ENV['DESTDIR']}/usr/local...") { Thread.current[:exit_code] = xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj', 'install', '>/dev/null') } or abort 'Failed to install Urho3D SDK'
|
|
wait_for_block("\nInstalling Urho3D SDK to #{ENV['DESTDIR']}/usr/local...") { Thread.current[:exit_code] = xcode_build(ENV['IOS'], '../Build/Urho3D.xcodeproj', 'install', '>/dev/null') } or abort 'Failed to install Urho3D SDK'
|
|
|
# Create a new project on the fly that uses newly installed Urho3D SDK
|
|
# Create a new project on the fly that uses newly installed Urho3D SDK
|
|
|
scaffolding "../Build/generated/UsingSDK"
|
|
scaffolding "../Build/generated/UsingSDK"
|
|
|
- system "export URHO3D_HOME=~/usr/local && cd ../Build/generated/UsingSDK && echo '\nDownstream project referencing Urho3D SDK' && ./cmake_macosx.sh . -DIOS=$IOS #{$build_options} -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure temporary downstream project using Urho3D as external library'
|
|
|
|
|
|
|
+ system "export URHO3D_HOME=~/usr/local && cd ../Build/generated/UsingSDK && echo '\nConfiguring downstream project using Urho3D SDK...' && ./cmake_macosx.sh . -DIOS=$IOS #{$build_options} -DURHO3D_LUA#{jit}=1 -DURHO3D_TESTING=#{$testing}" or abort 'Failed to configure temporary downstream project using Urho3D as external library'
|
|
|
xcode_build(ENV['IOS'], '../Build/generated/UsingSDK/Scaffolding.xcodeproj') or abort 'Failed to build/test temporary downstream project using Urho3D as external library'
|
|
xcode_build(ENV['IOS'], '../Build/generated/UsingSDK/Scaffolding.xcodeproj') or abort 'Failed to build/test temporary downstream project using Urho3D as external library'
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|