From 620d4f46f7c7ac60223851160a2afb6032f358ad Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 16 Jan 2019 16:25:30 -0800 Subject: [PATCH 1/5] Android build without libuuid dependency Tests disabled for Android --- CMakeLists.txt | 2 +- Source/Common/NMR_UUID.cpp | 7 ++ androidbuild.ps1 | 138 +++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 androidbuild.ps1 diff --git a/CMakeLists.txt b/CMakeLists.txt index decab635f..8ec64fb14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ if (UNIX OR MINGW) if (NOT APPLE) SET_TARGET_PROPERTIES(${PROJECT_NAME}_s PROPERTIES LINK_FLAGS -s) endif() - if(NOT IOS_PLATFORM) + if(NOT IOS_PLATFORM AND NOT ANDROID_PLATFORM) find_library(LIBUUID_PATH uuid) if(NOT LIBUUID_PATH) message(FATAL_ERROR "libuuid not found") diff --git a/Source/Common/NMR_UUID.cpp b/Source/Common/NMR_UUID.cpp index 65b89887b..10ee94dc4 100644 --- a/Source/Common/NMR_UUID.cpp +++ b/Source/Common/NMR_UUID.cpp @@ -40,6 +40,9 @@ NMR_UUID.cpp implements a datatype and functions to handle UUIDs #if defined(_WIN32) && !defined(__MINGW32__) #include #include +#elif defined(ANDROID) +#include +#include #else #include #endif @@ -56,6 +59,10 @@ namespace NMR if (StringFromCLSID(guid, &str) != S_OK) throw CNMRException(NMR_ERROR_UUIDGENERATIONFAILED); set(str); +#elif defined(ANDROID) + std::ifstream t("/proc/sys/kernel/random/uuid"); + std::string str((std::istreambuf_iterator(t)), std::istreambuf_iterator()); + set(str.c_str()); #else uuid_t uuid; uuid_generate_random(uuid); diff --git a/androidbuild.ps1 b/androidbuild.ps1 new file mode 100644 index 000000000..d0c8b77a6 --- /dev/null +++ b/androidbuild.ps1 @@ -0,0 +1,138 @@ +<# +/************************************************************** +* * +# Copyright (c) Microsoft Corporation. All rights reserved. * +# Licensed under the MIT License. * +* * +**************************************************************/ +.SYNOPSIS +Invokes CMake to build Canvas3d for android targets. + +.DESCRIPTION +It first creates ninja files as native build target. Then invokes ninja to kick off +actual build process. +Assumes, CMake, ninja and Android-ndk are available. + +.EXAMPLE +androidbuild.ps1 -arm64 +#> + +[CmdletBinding()] +param( + [switch]$Clean, + [switch]$Rebuild, + [switch]$arm64, + [switch]$arm32, + [switch]$x86, + [switch]$x86_64, + [switch]$NoDebug +) + +$ErrorActionPreference = "stop" +if($NoDebug) {$BuildType = "Release"} else { $BuildType = "Debug"} + +function GenerateNinjaFiles() +{ + $AndroidABI = findABI + $BuildDirName = getBuildDirName + Write-Host "Generating Android ninja files for $AndroidABI" + New-Item -Path "$PSScriptRoot\build" -Name $BuildDirName -ItemType Directory -Force | Out-Null + New-Item -Path "$PSScriptRoot\build\$BuildDirName" -Name $BuildType -ItemType Directory -Force | Out-Null + Push-Location "$PSScriptRoot\build\$BuildDirName\$BuildType" | Out-Null + + try + { + if (Test-Path Env:ANDROID_HOME) + { + $AndroidNDKRoot = "$Env:ANDROID_HOME\ndk-bundle" + } + else + { + $Appdata = [Environment]::GetFolderPath('ApplicationData') + $AndroidNDKRoot = "$Appdata\..\Local\Android\Sdk\ndk-bundle" + } + $AndroidToolChain = "$AndroidNDKRoot\build\cmake\android.toolchain.cmake" + $AndroidPlatform = "android-19" + + # A path with back-slash as separator can be passed to cmake via commandline but cannot be used in any cmake file. + # So, to avoid any confusion changing path separator to forward slash. + $AndroidToolChain = $AndroidToolChain -replace "\\", "/" + cmake ..\..\.. -DANDROID_ABI="$AndroidABI" -DANDROID_PLATFORM="$AndroidPlatform" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=intermediates -DCMAKE_BUILD_TYPE="$BuildType" -DCMAKE_TOOLCHAIN_FILE="$AndroidToolChain" -DCMAKE_CXX_FLAGS=-fexceptions -DANDROID_STL=c++_static -GNinja -DANDROID_OS_PLATFORM=ANDROID -DLIB3MF_TESTS=FALSE | Write-Host + } + finally + { + Pop-Location | Out-Null + } +} + +function BuildTarget() +{ + $BuildDirName = getBuildDirName + Push-Location "$PSScriptRoot\build\$BuildDirName\$BuildType" | Out-Null + try + { + cmake --build . --config "$BuildType" | Write-Host + } + finally + { + Pop-Location | Out-Null + } +} + +function cleanAllTargets() +{ + Remove-Item "$PSScriptRoot\Built" -Recurse -Force -ErrorAction Ignore | Write-Host +} + +function cleanTarget() +{ + # Delete both compilation and installation directories. + $BuildDirName = getBuildDirName + Remove-Item "$PSScriptRoot\build\$BuildDirName\$BuildType" -Recurse -Force -ErrorAction Ignore | Write-Host + #Remove-Item "$PSScriptRoot\Built\Out\$BuildDirName\$BuildType" -Recurse -Force -ErrorAction Ignore | Write-Host +} + +function findABI() +{ + $ABI = "x86" + if($arm32) + { + $ABI = "armeabi-v7a" + } + elseif($arm64) + { + $ABI = "arm64-v8a" + } + elseif($x86_64) + { + $abi = "x86_64" + } + return $ABI +} + +function getBuildDirName() +{ + $AndroidABI = findABI + $BuildDirName = "android_$AndroidABI" + return $BuildDirName +} + +function Main() +{ + if($Clean) + { + cleanTarget + } + else + { + if($Rebuild) + { + cleanTarget + } + + GenerateNinjaFiles + BuildTarget + } +} + +Main From 6dce023cd8cb2f6de7384c74d5b942d9ffe6f411 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 16 Jan 2019 16:49:00 -0800 Subject: [PATCH 2/5] nuget scripts for Android --- CMakeLists.txt | 1 + nuget/android/FindLib3MF.android.cmake | 13 +++++++++ nuget/android/Lib3MF.android.nuspec.in | 37 ++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 nuget/android/FindLib3MF.android.cmake create mode 100644 nuget/android/Lib3MF.android.nuspec.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ec64fb14..d0b3408d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Include/Model/COM/NMR_COMVersion.h.i configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nuget/ios/lib3mf.iOS.nuspec.in" "${CMAKE_CURRENT_BINARY_DIR}/nuget/ios/lib3mf.iOS.nuspec") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nuget/macos/lib3mf.macOS.nuspec.in" "${CMAKE_CURRENT_BINARY_DIR}/nuget/macos/lib3mf.macOS.nuspec") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nuget/windows/lib3mf.windows.nuspec.in" "${CMAKE_CURRENT_BINARY_DIR}/nuget/windows/lib3mf.windows.nuspec") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/nuget/android/lib3mf.android.nuspec.in" "${CMAKE_CURRENT_BINARY_DIR}/nuget/android/lib3mf.android.nuspec") include(Source/CMakeLists.txt) diff --git a/nuget/android/FindLib3MF.android.cmake b/nuget/android/FindLib3MF.android.cmake new file mode 100644 index 000000000..ad564f7eb --- /dev/null +++ b/nuget/android/FindLib3MF.android.cmake @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.9) + +if (NOT Lib3MF_ANDROID_FOUND) + set(Lib3MF_ANDROID_FOUND TRUE) + add_library(Lib3MF STATIC IMPORTED GLOBAL) + set_target_properties(Lib3MF PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/build/native/include") + set_target_properties(Lib3MF PROPERTIES IMPORTED_LOCATION_DEBUG "${CMAKE_CURRENT_LIST_DIR}/build/native/lib/${ANDROID_ABI}/Debug/static/lib3MF_s.a") + set_target_properties(Lib3MF PROPERTIES IMPORTED_LOCATION_RELEASE "${CMAKE_CURRENT_LIST_DIR}/build/native/lib/${ANDROID_ABI}/Release/static/lib3MF_s.a") + set_target_properties(Lib3MF PROPERTIES IMPORTED_LOCATION_RELWITHDEBINFO "${CMAKE_CURRENT_LIST_DIR}/build/native/lib/${ANDROID_ABI}/Release/static/lib3MF_s.a") + set_target_properties(Lib3MF PROPERTIES IMPORTED_LOCATION_MINSIZEREL "${CMAKE_CURRENT_LIST_DIR}/build/native/lib/${ANDROID_ABI}/Release/static/lib3MF_s.a") + # Default location for other build configurations defaults to Debug + set_target_properties(Lib3MF PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_LIST_DIR}/build/native/lib/${ANDROID_ABI}/Debug/static/lib3MF_s.a") +endif() \ No newline at end of file diff --git a/nuget/android/Lib3MF.android.nuspec.in b/nuget/android/Lib3MF.android.nuspec.in new file mode 100644 index 000000000..f63907939 --- /dev/null +++ b/nuget/android/Lib3MF.android.nuspec.in @@ -0,0 +1,37 @@ + + + + lib3mf.macos + ${LIB3MF_VERSION_MAJOR}.${LIB3MF_VERSION_MINOR}.${LIB3MF_VERSION_MICRO}.${BUILD_NUMBER} + Lib3MF from the 3MF Consortium + 3MF Consortium + 3MF Consortium + false + A C++ library for decoding and encoding 3mf files. + Copyright (C) 2015 Microsoft Corporation Copyright (C) 2015 netfabb GmbH + + + + + + + + + + + + + + + + + + + + + + + + + + From be7869119966e24f2a489a14af8354e13ed34571 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Wed, 16 Jan 2019 16:49:45 -0800 Subject: [PATCH 3/5] wrong nupkg name fix --- nuget/android/Lib3MF.android.nuspec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nuget/android/Lib3MF.android.nuspec.in b/nuget/android/Lib3MF.android.nuspec.in index f63907939..ef590fdff 100644 --- a/nuget/android/Lib3MF.android.nuspec.in +++ b/nuget/android/Lib3MF.android.nuspec.in @@ -1,7 +1,7 @@ - lib3mf.macos + lib3mf.android ${LIB3MF_VERSION_MAJOR}.${LIB3MF_VERSION_MINOR}.${LIB3MF_VERSION_MICRO}.${BUILD_NUMBER} Lib3MF from the 3MF Consortium 3MF Consortium From 23f1b162dfb148250635f981d332cfd8ee11cb1d Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Thu, 17 Jan 2019 10:13:27 -0800 Subject: [PATCH 4/5] enable tests for Android fixed wstring cast --- UnitTests/Source/UnitTest_Extensions.cpp | 8 ++++---- androidbuild.ps1 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UnitTests/Source/UnitTest_Extensions.cpp b/UnitTests/Source/UnitTest_Extensions.cpp index 0100eaed0..ac0efe2db 100644 --- a/UnitTests/Source/UnitTest_Extensions.cpp +++ b/UnitTests/Source/UnitTest_Extensions.cpp @@ -77,25 +77,25 @@ namespace NMR { S_OK) << L"Failed to check Materials-Spec"; EXPECT_TRUE(bIsSupported) << L"Materials-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for Materials-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_MATERIALSPEC)); - EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_MATERIALSPEC)) << errString; + EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_MATERIALSPEC)) << errString.c_str(); EXPECT_EQ(NMR::lib3mf_queryextension(L"http://schemas.microsoft.com/3dmanufacturing/production/2015/06", &bIsSupported, &nAPIInterfaceVersion), S_OK) << L"Failed to check Production-Spec"; EXPECT_TRUE(bIsSupported) << L"Production-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for Production-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_PRODUCTIONSEPC)); - EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_PRODUCTIONSEPC)) << errString; + EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_PRODUCTIONSEPC)) << errString.c_str(); EXPECT_EQ(NMR::lib3mf_queryextension(L"http://schemas.microsoft.com/3dmanufacturing/slice/2015/07", &bIsSupported, &nAPIInterfaceVersion), S_OK) << L"Failed to check Slice-Spec"; EXPECT_TRUE(bIsSupported) << L"Slice-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for Production-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_SLICESPEC)); - EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_SLICESPEC)) << errString; + EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_SLICESPEC)) << errString.c_str(); EXPECT_EQ(NMR::lib3mf_queryextension(L"http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02", &bIsSupported, &nAPIInterfaceVersion), S_OK) << L"Failed to check Beam-Spec"; EXPECT_TRUE(bIsSupported) << L"Beam-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for BeamLattice-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_BEAMLATTICESPEC)); - EXPECT_EQ(nAPIInterfaceVersion,(DWORD)(NMR_APIVERSION_INTERFACE_BEAMLATTICESPEC)) << errString; + EXPECT_EQ(nAPIInterfaceVersion,(DWORD)(NMR_APIVERSION_INTERFACE_BEAMLATTICESPEC)) << errString.c_str(); } TEST(Extensions, RequiredExtensions_Pass) diff --git a/androidbuild.ps1 b/androidbuild.ps1 index d0c8b77a6..b85c02fad 100644 --- a/androidbuild.ps1 +++ b/androidbuild.ps1 @@ -57,7 +57,7 @@ function GenerateNinjaFiles() # A path with back-slash as separator can be passed to cmake via commandline but cannot be used in any cmake file. # So, to avoid any confusion changing path separator to forward slash. $AndroidToolChain = $AndroidToolChain -replace "\\", "/" - cmake ..\..\.. -DANDROID_ABI="$AndroidABI" -DANDROID_PLATFORM="$AndroidPlatform" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=intermediates -DCMAKE_BUILD_TYPE="$BuildType" -DCMAKE_TOOLCHAIN_FILE="$AndroidToolChain" -DCMAKE_CXX_FLAGS=-fexceptions -DANDROID_STL=c++_static -GNinja -DANDROID_OS_PLATFORM=ANDROID -DLIB3MF_TESTS=FALSE | Write-Host + cmake ..\..\.. -DANDROID_ABI="$AndroidABI" -DANDROID_PLATFORM="$AndroidPlatform" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=intermediates -DCMAKE_BUILD_TYPE="$BuildType" -DCMAKE_TOOLCHAIN_FILE="$AndroidToolChain" -DCMAKE_CXX_FLAGS=-fexceptions -DANDROID_STL=c++_static -GNinja -DANDROID_OS_PLATFORM=ANDROID -DLIB3MF_TESTS=TRUE | Write-Host } finally { From 69a3b960582c15d3e56aa0f75038159c20561987 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Thu, 17 Jan 2019 14:24:40 -0800 Subject: [PATCH 5/5] - Moved and rename android build script - renamed android/FindLib3MF.Android.cmake - preprocessor definition for wstring overloading --- UnitTests/Source/UnitTest_Extensions.cpp | 8 ++++---- androidbuild.ps1 => cmake/BuildAndroid.ps1 | 13 ++++++------- ...ib3MF.android.cmake => FindLib3MF.Android.cmake} | 0 ...F.android.nuspec.in => Lib3MF.Android.nuspec.in} | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) rename androidbuild.ps1 => cmake/BuildAndroid.ps1 (82%) rename nuget/android/{FindLib3MF.android.cmake => FindLib3MF.Android.cmake} (100%) rename nuget/android/{Lib3MF.android.nuspec.in => Lib3MF.Android.nuspec.in} (98%) diff --git a/UnitTests/Source/UnitTest_Extensions.cpp b/UnitTests/Source/UnitTest_Extensions.cpp index ac0efe2db..0100eaed0 100644 --- a/UnitTests/Source/UnitTest_Extensions.cpp +++ b/UnitTests/Source/UnitTest_Extensions.cpp @@ -77,25 +77,25 @@ namespace NMR { S_OK) << L"Failed to check Materials-Spec"; EXPECT_TRUE(bIsSupported) << L"Materials-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for Materials-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_MATERIALSPEC)); - EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_MATERIALSPEC)) << errString.c_str(); + EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_MATERIALSPEC)) << errString; EXPECT_EQ(NMR::lib3mf_queryextension(L"http://schemas.microsoft.com/3dmanufacturing/production/2015/06", &bIsSupported, &nAPIInterfaceVersion), S_OK) << L"Failed to check Production-Spec"; EXPECT_TRUE(bIsSupported) << L"Production-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for Production-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_PRODUCTIONSEPC)); - EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_PRODUCTIONSEPC)) << errString.c_str(); + EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_PRODUCTIONSEPC)) << errString; EXPECT_EQ(NMR::lib3mf_queryextension(L"http://schemas.microsoft.com/3dmanufacturing/slice/2015/07", &bIsSupported, &nAPIInterfaceVersion), S_OK) << L"Failed to check Slice-Spec"; EXPECT_TRUE(bIsSupported) << L"Slice-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for Production-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_SLICESPEC)); - EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_SLICESPEC)) << errString.c_str(); + EXPECT_EQ(nAPIInterfaceVersion, (DWORD)(NMR_APIVERSION_INTERFACE_SLICESPEC)) << errString; EXPECT_EQ(NMR::lib3mf_queryextension(L"http://schemas.microsoft.com/3dmanufacturing/beamlattice/2017/02", &bIsSupported, &nAPIInterfaceVersion), S_OK) << L"Failed to check Beam-Spec"; EXPECT_TRUE(bIsSupported) << L"Beam-Spec not supported"; errString = std::wstring(L"invalid 3MF API interface version for BeamLattice-Spec: " + std::to_wstring(NMR_APIVERSION_INTERFACE_BEAMLATTICESPEC)); - EXPECT_EQ(nAPIInterfaceVersion,(DWORD)(NMR_APIVERSION_INTERFACE_BEAMLATTICESPEC)) << errString.c_str(); + EXPECT_EQ(nAPIInterfaceVersion,(DWORD)(NMR_APIVERSION_INTERFACE_BEAMLATTICESPEC)) << errString; } TEST(Extensions, RequiredExtensions_Pass) diff --git a/androidbuild.ps1 b/cmake/BuildAndroid.ps1 similarity index 82% rename from androidbuild.ps1 rename to cmake/BuildAndroid.ps1 index b85c02fad..32ce0438c 100644 --- a/androidbuild.ps1 +++ b/cmake/BuildAndroid.ps1 @@ -36,9 +36,9 @@ function GenerateNinjaFiles() $AndroidABI = findABI $BuildDirName = getBuildDirName Write-Host "Generating Android ninja files for $AndroidABI" - New-Item -Path "$PSScriptRoot\build" -Name $BuildDirName -ItemType Directory -Force | Out-Null - New-Item -Path "$PSScriptRoot\build\$BuildDirName" -Name $BuildType -ItemType Directory -Force | Out-Null - Push-Location "$PSScriptRoot\build\$BuildDirName\$BuildType" | Out-Null + New-Item -Path "$PSScriptRoot\..\build" -Name $BuildDirName -ItemType Directory -Force | Out-Null + New-Item -Path "$PSScriptRoot\..\build\$BuildDirName" -Name $BuildType -ItemType Directory -Force | Out-Null + Push-Location "$PSScriptRoot\..\build\$BuildDirName\$BuildType" | Out-Null try { @@ -52,12 +52,12 @@ function GenerateNinjaFiles() $AndroidNDKRoot = "$Appdata\..\Local\Android\Sdk\ndk-bundle" } $AndroidToolChain = "$AndroidNDKRoot\build\cmake\android.toolchain.cmake" - $AndroidPlatform = "android-19" + $AndroidPlatform = "android-21" # A path with back-slash as separator can be passed to cmake via commandline but cannot be used in any cmake file. # So, to avoid any confusion changing path separator to forward slash. $AndroidToolChain = $AndroidToolChain -replace "\\", "/" - cmake ..\..\.. -DANDROID_ABI="$AndroidABI" -DANDROID_PLATFORM="$AndroidPlatform" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=intermediates -DCMAKE_BUILD_TYPE="$BuildType" -DCMAKE_TOOLCHAIN_FILE="$AndroidToolChain" -DCMAKE_CXX_FLAGS=-fexceptions -DANDROID_STL=c++_static -GNinja -DANDROID_OS_PLATFORM=ANDROID -DLIB3MF_TESTS=TRUE | Write-Host + cmake ..\..\.. -DANDROID_ABI="$AndroidABI" -DANDROID_PLATFORM="$AndroidPlatform" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=intermediates -DCMAKE_BUILD_TYPE="$BuildType" -DCMAKE_TOOLCHAIN_FILE="$AndroidToolChain" -DCMAKE_CXX_FLAGS="-fexceptions -DGTEST_HAS_STD_WSTRING" -DANDROID_STL=c++_static -GNinja -DANDROID_OS_PLATFORM=ANDROID -DLIB3MF_TESTS=TRUE | Write-Host } finally { @@ -68,7 +68,7 @@ function GenerateNinjaFiles() function BuildTarget() { $BuildDirName = getBuildDirName - Push-Location "$PSScriptRoot\build\$BuildDirName\$BuildType" | Out-Null + Push-Location "$PSScriptRoot\..\build\$BuildDirName\$BuildType" | Out-Null try { cmake --build . --config "$BuildType" | Write-Host @@ -89,7 +89,6 @@ function cleanTarget() # Delete both compilation and installation directories. $BuildDirName = getBuildDirName Remove-Item "$PSScriptRoot\build\$BuildDirName\$BuildType" -Recurse -Force -ErrorAction Ignore | Write-Host - #Remove-Item "$PSScriptRoot\Built\Out\$BuildDirName\$BuildType" -Recurse -Force -ErrorAction Ignore | Write-Host } function findABI() diff --git a/nuget/android/FindLib3MF.android.cmake b/nuget/android/FindLib3MF.Android.cmake similarity index 100% rename from nuget/android/FindLib3MF.android.cmake rename to nuget/android/FindLib3MF.Android.cmake diff --git a/nuget/android/Lib3MF.android.nuspec.in b/nuget/android/Lib3MF.Android.nuspec.in similarity index 98% rename from nuget/android/Lib3MF.android.nuspec.in rename to nuget/android/Lib3MF.Android.nuspec.in index ef590fdff..a83296f7e 100644 --- a/nuget/android/Lib3MF.android.nuspec.in +++ b/nuget/android/Lib3MF.Android.nuspec.in @@ -32,6 +32,6 @@ - +