Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
kpgalligan committed Aug 19, 2020
1 parent 4bb5b17 commit b6877f6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion KotlinCpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(cpp)
set(CMAKE_CXX_STANDARD 11)


include_directories(/Users/kgalligan/devel_kmp/kotlin-native-latest/runtime/src/main/cpp)
include_directories(/Users/kgalligan/devel_kmp/kotlin-native-again/runtime/src/main/cpp)

include_directories(knarch/src/main/cpp)

Expand Down
2 changes: 1 addition & 1 deletion KotlinCpp/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ org.gradle.workers.max=4

#kotlinProjectPath=/Users/jetbrains/kotlin-native/kotlin

konanDevPath=/Users/kgalligan/temp/kotlin-native-master-hold
konanDevPath=/Users/kgalligan/devel_kmp/kotlin-native-again
2 changes: 1 addition & 1 deletion KotlinCpp/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 5 additions & 1 deletion KotlinCpp/knarch/src/main/cpp/KonanHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ void DisposeCStringHelper(char *cstring) {
if (cstring) konan::free(cstring);
}

void knarchLog(const char* tag, const char* format, ...){
int globalLogLevel = LOG_NEVER;

void knarchLog(int logLevel, const char* tag, const char* format, ...){
if(logLevel >= globalLogLevel) {
printf("%s", tag);
printf(" - ");
va_list args;
va_start(args, format);
vprintf(format, args);
va_end(args);
printf("\n");
}
}

} // extern "C"
11 changes: 8 additions & 3 deletions KotlinCpp/knarch/src/main/cpp/KonanHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@
#include "Types.h"
#include "TypeInfo.h"

#define LOG_VERBOSE 1
#define LOG_DEBUG 2
#define LOG_INFO 3
#define LOG_WARN 4
#define LOG_ERROR 5
#define LOG_NEVER 6

#ifdef __cplusplus
extern "C" {
#endif

char* CreateCStringFromStringWithSize(KString kstring, size_t* utf8Size);
void DisposeCStringHelper(char* cstring);

void knarchLog(const char* tag, const char* format, ...);


void knarchLog(int logLevel, const char* tag, const char* format, ...);

#ifdef __cplusplus
}
Expand Down
8 changes: 4 additions & 4 deletions KotlinCpp/knarch/src/main/cpp/SQLiteCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
#define SQLITE_LOG_TAG "SQLiteLog"
#define SQLITE_TRACE_TAG "SQLiteStatements"
#define SQLITE_PROFILE_TAG "SQLiteTime"
#define ALOGE(...) knarchLog("ERROR", __VA_ARGS__)
#define ALOGW(...) knarchLog("WARN", __VA_ARGS__)
#define ALOGV(...) //knarchLog("VERBOSE", __VA_ARGS__) Need a way to turn log levels on/off that doesn't require compiling...
#define ALOG(tag, ...) knarchLog(tag, __VA_ARGS__)
#define ALOGE(...) knarchLog(LOG_ERROR, "ERROR", __VA_ARGS__)
#define ALOGW(...) knarchLog(LOG_WARN, "WARN", __VA_ARGS__)
#define ALOGV(...) knarchLog(LOG_VERBOSE, "VERBOSE", __VA_ARGS__)
#define ALOG(tag, ...) knarchLog(LOG_INFO, tag, __VA_ARGS__)

extern "C" {
RUNTIME_NORETURN void ThrowSql_IllegalStateException(KString str);
Expand Down
2 changes: 1 addition & 1 deletion KotlinCpp/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ include ':knarch'
import org.jetbrains.kotlin.DistroHelperKt

//There are dependency issues with native, so we're back to local-only builds for a bit
String konanPath = "/Users/kgalligan/temp/kotlin-native-master-hold"
String konanPath = "/Users/kgalligan/devel_kmp/kotlin-native-again"
//String konanPath = "C:\\Users\\kgalligan\\devel\\kotlin-native"

if (konanPath == null) {
Expand Down

0 comments on commit b6877f6

Please sign in to comment.