mirror of https://github.com/oxen-io/lokinet
include all platform dependencies transitively
This commit is contained in:
parent
e15c57c114
commit
6d49ffd60b
|
@ -20,7 +20,7 @@ if(NOT MSVC_VERSION)
|
|||
# GNU ld sees fit to merge *all* the .ident sections in object files
|
||||
# to .r[o]data section one after the other!
|
||||
add_compile_options(-fno-ident -Wa,-mbig-obj)
|
||||
link_libraries( -lws2_32 -liphlpapi -lshlwapi -ldbghelp )
|
||||
link_libraries( -lshlwapi -ldbghelp )
|
||||
add_definitions(-DWINVER=0x0500 -D_WIN32_WINNT=0x0500)
|
||||
endif()
|
||||
|
||||
|
@ -31,7 +31,7 @@ endif()
|
|||
list(APPEND LIBTUNTAP_SRC ${TT_ROOT}/tuntap-windows.c)
|
||||
get_filename_component(EV_SRC "llarp/ev/ev_libuv.cpp" ABSOLUTE)
|
||||
add_definitions(-DWIN32_LEAN_AND_MEAN -DWIN32 -DWINVER=0x0500)
|
||||
set(EXE_LIBS ${STATIC_LIB} ws2_32 iphlpapi)
|
||||
set(EXE_LIBS ${STATIC_LIB} ${FS_LIB})
|
||||
|
||||
if(RELEASE_MOTTO)
|
||||
add_definitions(-DLLARP_RELEASE_MOTTO="${RELEASE_MOTTO}")
|
||||
|
|
|
@ -54,19 +54,13 @@ else()
|
|||
endif(CURL_FOUND)
|
||||
if(WIN32)
|
||||
target_include_directories(${CTL} PRIVATE ../win32-setup/include)
|
||||
target_include_directories(${EXE} PRIVATE ../win32-setup/include)
|
||||
target_compile_definitions(${CTL} PRIVATE -DWITH_CURL=1 -DCURL_STATICLIB)
|
||||
target_compile_definitions(${EXE} PRIVATE -DWITH_CURL=1 -DCURL_STATICLIB)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
target_link_directories(${CTL} PRIVATE ../win32-setup/lib64)
|
||||
target_link_directories(${EXE} PRIVATE ../win32-setup/lib64)
|
||||
target_link_libraries(${CTL} PRIVATE curl crypt32)
|
||||
target_link_libraries(${EXE} PRIVATE curl crypt32)
|
||||
else()
|
||||
target_link_directories(${CTL} PRIVATE ../win32-setup/lib)
|
||||
target_link_directories(${EXE} PRIVATE ../win32-setup/lib)
|
||||
target_link_libraries(${CTL} PRIVATE curl mbedtls mbedx509 mbedcrypto ws2_32)
|
||||
target_link_libraries(${EXE} PRIVATE curl mbedtls mbedx509 mbedcrypto ws2_32)
|
||||
endif()
|
||||
endif(WIN32)
|
||||
|
||||
|
|
|
@ -68,9 +68,9 @@ if (WIN32)
|
|||
target_include_directories(${UTIL_LIB} PUBLIC ../win32-setup/include)
|
||||
target_compile_definitions(${UTIL_LIB} PUBLIC -DCURL_STATICLIB)
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
target_link_libraries(${UTIL_LIB} PUBLIC ${CRYPTOGRAPHY_LIB} ${FS_LIB} ${LOG_LIB} curl crypt32 ws2_32)
|
||||
target_link_libraries(${UTIL_LIB} PUBLIC ${CRYPTOGRAPHY_LIB} ${FS_LIB} ${LOG_LIB} curl crypt32 ws2_32 iphlpapi)
|
||||
else()
|
||||
target_link_libraries(${UTIL_LIB} PUBLIC ${CRYPTOGRAPHY_LIB} ${FS_LIB} ${LOG_LIB} curl mbedtls mbedx509 mbedcrypto ws2_32)
|
||||
target_link_libraries(${UTIL_LIB} PUBLIC ${CRYPTOGRAPHY_LIB} ${FS_LIB} ${LOG_LIB} curl mbedtls mbedx509 mbedcrypto ws2_32 iphlpapi)
|
||||
endif()
|
||||
endif()
|
||||
if(ANDROID)
|
||||
|
@ -263,9 +263,6 @@ if(TESTNET)
|
|||
endif()
|
||||
|
||||
add_library(${STATIC_LIB} STATIC ${LIB_SRC})
|
||||
if (WIN32)
|
||||
target_include_directories(${STATIC_LIB} PUBLIC ../win32-setup/include)
|
||||
endif()
|
||||
target_include_directories(${STATIC_LIB} PUBLIC ${CURL_INCLUDE_DIRS})
|
||||
target_link_libraries(${STATIC_LIB} PUBLIC cxxopts ${ABYSS_LIB} ${PLATFORM_LIB} ${UTIL_LIB} ${CRYPTOGRAPHY_LIB} ${CURL_LIBRARIES})
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ add_executable(${TEST_EXE}
|
|||
${TEST_SRC}
|
||||
)
|
||||
|
||||
target_link_libraries(${TEST_EXE} PUBLIC gmock gtest curl ${STATIC_LIB})
|
||||
target_link_libraries(${TEST_EXE} PUBLIC gmock gtest ${STATIC_LIB})
|
||||
target_include_directories(${TEST_EXE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if(NOT WIN32)
|
||||
|
|
|
@ -14,16 +14,19 @@ namespace network.loki.lokinet.win32.ui
|
|||
{
|
||||
InitializeComponent();
|
||||
if (Program.platform == PlatformID.Win32NT)
|
||||
default_path = Environment.ExpandEnvironmentVariables("%APPDATA%\\.lokinet\\bootstrap.signed");
|
||||
default_path = Environment.ExpandEnvironmentVariables("%APPDATA%\\.lokinet");
|
||||
else
|
||||
default_path = Environment.ExpandEnvironmentVariables("%HOME%/.lokinet/bootstrap.signed");
|
||||
label2.Text = String.Format("This file is automatically saved as {0}.", default_path);
|
||||
default_path = Environment.ExpandEnvironmentVariables("%HOME%/.lokinet");
|
||||
label2.Text = String.Format("This file is automatically saved as {0}{1}{2}.", default_path, Path.DirectorySeparatorChar, rcName);
|
||||
}
|
||||
|
||||
private WebClient wc;
|
||||
private string default_path;
|
||||
private const string rcName = "bootstrap.signed";
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
Directory.CreateDirectory(default_path);
|
||||
// add something more unique, this is the IE 5.0 default string
|
||||
try
|
||||
{
|
||||
|
@ -31,7 +34,7 @@ namespace network.loki.lokinet.win32.ui
|
|||
ServicePointManager.SecurityProtocol = (SecurityProtocolType)48 | 0 | (SecurityProtocolType)192 | (SecurityProtocolType)768 | (SecurityProtocolType)3072;
|
||||
wc = new WebClient();
|
||||
wc.Headers.Add("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT 5.0)");
|
||||
wc.DownloadFile(uriBox.Text, default_path);
|
||||
wc.DownloadFile(uriBox.Text, string.Format("{0}{1}{2}", default_path, Path.DirectorySeparatorChar, rcName));
|
||||
MessageBox.Show("LokiNET node bootstrapped", "LokiNET", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
@ -49,7 +52,7 @@ namespace network.loki.lokinet.win32.ui
|
|||
lokinet_bootstrap.StartInfo.CreateNoWindow = true;
|
||||
lokinet_bootstrap.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
|
||||
lokinet_bootstrap.StartInfo.FileName = lokinetExeString;
|
||||
lokinet_bootstrap.StartInfo.Arguments = string.Format("--cacert rootcerts.pem -L {0} --output \"{1}\"", uriBox.Text, default_path);
|
||||
lokinet_bootstrap.StartInfo.Arguments = string.Format("--cacert rootcerts.pem -L {0} --output \"{1}{2}{3}\"", uriBox.Text, default_path, Path.DirectorySeparatorChar, rcName);
|
||||
lokinet_bootstrap.Start();
|
||||
lokinet_bootstrap.WaitForExit();
|
||||
if (lokinet_bootstrap.ExitCode == 0)
|
||||
|
|
Loading…
Reference in New Issue