mirror of
https://github.com/amnezia-vpn/euphoria-windows.git
synced 2026-05-17 00:05:59 +03:00
minor modifications
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
.deps
|
||||
tunnel.dll
|
||||
tunnel.h
|
||||
x64/
|
||||
@@ -1,30 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
## Download and extract wintun.dll and friends.
|
||||
file(DOWNLOAD https://www.wintun.net/builds/wintun-0.12.zip
|
||||
${CMAKE_CURRENT_BINARY_DIR}/.deps/wintun.zip
|
||||
EXPECTED_HASH SHA256=eba90e26686ed86595ae0a6d4d3f4f022924b1758f5148a32a91c60cc6e604df)
|
||||
|
||||
file(ARCHIVE_EXTRACT INPUT ${CMAKE_CURRENT_BINARY_DIR}/.deps/wintun.zip DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/.deps)
|
||||
|
||||
## Build the tunnel DLL
|
||||
add_custom_target(tunneldll ALL
|
||||
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/tunnel.dll ${CMAKE_CURRENT_BINARY_DIR}/tunnel.h
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
GOCACHE=${CMAKE_BINARY_DIR}/go-cache
|
||||
GOOS=windows CGO_ENABLED=1
|
||||
CC=gcc
|
||||
CGO_CFLAGS="-O3 -Wall -Wno-unused-function -Wno-switch -std=gnu11 -DWINVER=0x0601"
|
||||
CGO_LDFLAGS="-Wl,--dynamicbase -Wl,--nxcompat -Wl,--export-all-symbols -Wl,--high-entropy-va"
|
||||
go build -buildmode c-shared -ldflags="-w -s" -trimpath -v -o "${CMAKE_CURRENT_BINARY_DIR}/tunnel.dll"
|
||||
)
|
||||
set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_BINARY_DIR}/go-cache)
|
||||
|
||||
install(FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/tunnel.dll
|
||||
${CMAKE_CURRENT_BINARY_DIR}/.deps/wintun/bin/${CMAKE_SYSTEM_PROCESSOR}/wintun.dll
|
||||
DESTINATION .
|
||||
)
|
||||
@@ -37,11 +37,11 @@ if exist .deps\prepared goto :build
|
||||
|
||||
:download
|
||||
echo [+] Downloading %1
|
||||
powershell -command "Invoke-WebRequest" -Uri %2 -OutFile %1 || exit /b 1
|
||||
curl -#fLo %1 %2 || exit /b 1
|
||||
echo [+] Verifying %1
|
||||
for /f %%a in ('CertUtil -hashfile %1 SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="%~3" exit /b 1
|
||||
echo [+] Extracting %1
|
||||
powershell -command "Expand-Archive" -Path %1 -DestinationPath %cd% || exit /b 1
|
||||
tar -xf %1 %~4 || exit /b 1
|
||||
echo [+] Cleaning up %1
|
||||
del %1 || exit /b 1
|
||||
goto :eof
|
||||
|
||||
Reference in New Issue
Block a user