From 514a8ac8fc901b6d9d9cfab6041c567b8599c4d7 Mon Sep 17 00:00:00 2001 From: Janrupf Date: Tue, 31 Mar 2020 23:13:28 +0200 Subject: [PATCH 1/2] Statically link VC runtime --- .gitignore | 3 ++- opus-jni-native/CMakeLists.txt | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7c92d7b..9dfd165 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ build/ cmake-build*/ -.gradle/ \ No newline at end of file +.gradle/ +*.log diff --git a/opus-jni-native/CMakeLists.txt b/opus-jni-native/CMakeLists.txt index be1c788..07c428b 100644 --- a/opus-jni-native/CMakeLists.txt +++ b/opus-jni-native/CMakeLists.txt @@ -1,3 +1,9 @@ +################### +# Policy settings # +################### +cmake_policy(SET CMP0091 NEW) +cmake_policy(SET CMP0048 NEW) + ################# # Project setup # ################# @@ -41,4 +47,16 @@ set(OPUS_JNI_NATIVE_SOURCES ############## add_library(opus-jni-native SHARED ${OPUS_JNI_NATIVE_SOURCES}) target_link_libraries(opus-jni-native PUBLIC opus ${JNI_LIBRARIES}) -target_include_directories(opus-jni-native PUBLIC ${JNI_INCLUDE_DIRS} ${GENERATED_JNI_HEADERS_DIR}) \ No newline at end of file +target_include_directories(opus-jni-native PUBLIC ${JNI_INCLUDE_DIRS} ${GENERATED_JNI_HEADERS_DIR}) + +if(MSVC) + set_property( + TARGET opus + PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug":wq + ) + + set_property( + TARGET opus-jni-native + PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug" + ) +endif() \ No newline at end of file From 44543f9c715c073031af2f4ea47a9bd98b14dc06 Mon Sep 17 00:00:00 2001 From: Janrupf Date: Tue, 31 Mar 2020 23:15:32 +0200 Subject: [PATCH 2/2] And that was VIM... --- opus-jni-native/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opus-jni-native/CMakeLists.txt b/opus-jni-native/CMakeLists.txt index 07c428b..c2f8307 100644 --- a/opus-jni-native/CMakeLists.txt +++ b/opus-jni-native/CMakeLists.txt @@ -52,7 +52,7 @@ target_include_directories(opus-jni-native PUBLIC ${JNI_INCLUDE_DIRS} ${GENERATE if(MSVC) set_property( TARGET opus - PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug":wq + PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedDebug" ) set_property(