Browse Source

Fix release APK builds

Panagiotis Christopoulos Charitos 4 years ago
parent
commit
4f5f694653

+ 2 - 0
AnKi/Core/App.cpp

@@ -323,6 +323,8 @@ Error App::initInternal(const ConfigSet& config_, AllocAlignedCallback allocCb,
 {
 	setSignalHandlers();
 
+	Thread::setNameOfCurrentThread("anki_main");
+
 	ConfigSet config = config_;
 	m_displayStats = config.getNumberU32("core_displayStats");
 

+ 1 - 0
AnKi/Util/Forward.h

@@ -33,6 +33,7 @@ class ListAuto;
 template<typename T, typename TIndex>
 class SparseArray;
 
+class CString;
 class String;
 class StringAuto;
 

+ 6 - 0
AnKi/Util/Thread.h

@@ -23,6 +23,9 @@
 namespace anki
 {
 
+// Forward
+class CString;
+
 /// @addtogroup util_thread
 /// @{
 
@@ -103,6 +106,9 @@ public:
 	/// @param coreAffintyMask Pin the thread to a number of cores.
 	void pinToCores(const ThreadCoreAffinityMask& coreAffintyMask);
 
+	/// Name the current thread.
+	static void setNameOfCurrentThread(const CString& name);
+
 private:
 	/// The system native type.
 #if ANKI_POSIX

+ 7 - 1
AnKi/Util/ThreadPosix.cpp

@@ -5,6 +5,7 @@
 
 #include <AnKi/Util/Thread.h>
 #include <AnKi/Util/Logger.h>
+#include <AnKi/Util/String.h>
 
 namespace anki
 {
@@ -29,7 +30,7 @@ void Thread::start(void* userData, ThreadCallback callback, const ThreadCoreAffi
 		// Set thread name
 		if(thread->m_name[0] != '\0')
 		{
-			pthread_setname_np(pthread_self(), &thread->m_name[0]);
+			setNameOfCurrentThread(&thread->m_name[0]);
 		}
 
 		// Call the callback
@@ -96,4 +97,9 @@ void Thread::pinToCores(const ThreadCoreAffinityMask& coreAffintyMask)
 	}
 }
 
+void Thread::setNameOfCurrentThread(const CString& name)
+{
+	pthread_setname_np(pthread_self(), name.cstr());
+}
+
 } // end namespace anki

+ 5 - 0
AnKi/Util/ThreadWindows.cpp

@@ -105,4 +105,9 @@ void Thread::pinToCores(const ThreadCoreAffinityMask& coreAffintyMask)
 	}
 }
 
+void Thread::setNameOfCurrentThread(const CString& name)
+{
+	// TODO
+}
+
 } // end namespace anki

+ 4 - 0
Tools/Android/app/build.gradle

@@ -44,6 +44,10 @@ android {
                     targets "%TARGET%"
                 }
             }
+
+            debuggable true
+            jniDebuggable true
+            signingConfig signingConfigs.debug
         }
     }