diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 246c93c..415ce23 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -105,7 +105,7 @@ jobs: # NOTE: execute *AFTER* dependency installation to ensure that it uses a git checkout! - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure run: | diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 347dcb3..094e771 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -11,37 +11,20 @@ jobs: strategy: matrix: - qt: [5.15.*, 6.6.*] + # temporarily disabled + #qt: [5.15.*, 6.6.*] + qt: [5.15.*] fail-fast: false steps: - name: Checkout - uses: actions/checkout@v3 - - - name: Check out scrypt - uses: actions/checkout@master + uses: actions/checkout@v4 with: - repository: barrysteyn/scrypt-windows - path: scrypt-windows + submodules: true - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - - name: Install node - uses: actions/setup-node@master - - - name: Install node-gyp - shell: powershell - run: | - npm install --global node-gyp@latest - - - name: Build scrypt-windows - working-directory: scrypt-windows - run: | - node-gyp configure - node-gyp build - node-gyp install - - name: Install Qt uses: jurplel/install-qt-action@v3 with: @@ -52,13 +35,9 @@ jobs: setup-python: false - name: Configure - env: - CXXFLAGS: -I${{ github.workspace }}/scrypt-windows/scrypt-1.1.6/lib - run: > - cmake -B ${{ runner.temp }}/build - "-DCMAKE_LIBRARY_PATH=${{ github.workspace }}/scrypt-windows/build/Release" - . + run: | + cmake -B ${{ runner.temp }}/build . - name: Build run: | - cmake --build ${{ runner.temp }}/build + cmake --build ${{ runner.temp }}/build --verbose diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7330098..fb0f9f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,9 @@ on: - cron: '16 3 10 * *' jobs: - matrix-linux: - uses: ./.github/workflows/build-linux.yml + # temporary disabled + #matrix-linux: + # uses: ./.github/workflows/build-linux.yml matrix-windows: uses: ./.github/workflows/build-windows.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..42a3833 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/3rdparty/scrypt/scrypt-windows"] + path = src/3rdparty/scrypt/scrypt-windows + url = git@github.com:barrysteyn/scrypt-windows.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 909af8c..ed07f25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,13 +83,32 @@ if(UNIX) endif() if(WIN32) - find_library(SCRYPT_LIBRARY NAMES scrypt scrypt_lib) - target_link_options(${TARGET} BEFORE PRIVATE - /LTCG /INCREMENTAL:NO - /NODEFAULTLIB:libcmt.lib + set(SCRYPT_WINDOWS_LIB scrypt-windows) + set(SCRYPT_WINDOWS_DIR src/3rdparty/scrypt/scrypt-windows) + set(SCRYPT_SOURCE_DIR ${SCRYPT_WINDOWS_DIR}/scrypt-1.1.6) + add_library(${SCRYPT_WINDOWS_LIB} STATIC + ${SCRYPT_SOURCE_DIR}/lib/crypto/crypto_scrypt-sse.c + ${SCRYPT_SOURCE_DIR}/lib/crypto/sha256.c + ${SCRYPT_WINDOWS_DIR}/win/mman.c ) + set_target_properties(${SCRYPT_WINDOWS_LIB} PROPERTIES + AUTOMOC OFF + AUTOUIC OFF + LINKER_LANGUAGE CXX + ) + + target_include_directories(${SCRYPT_WINDOWS_LIB} PRIVATE + ${SCRYPT_SOURCE_DIR} + ${SCRYPT_SOURCE_DIR}/lib/crypto + ${SCRYPT_SOURCE_DIR}/lib/scryptenc + ${SCRYPT_SOURCE_DIR}/lib/util + ) + target_include_directories(${TARGET} PRIVATE + ${SCRYPT_SOURCE_DIR}/lib + ) + target_link_libraries(${TARGET} PRIVATE - ${SCRYPT_LIBRARY} + ${SCRYPT_WINDOWS_LIB} ws2_32 ) endif() diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index ca8595b..cbcce93 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -1,4 +1,6 @@ if(WIN32) + #add_subdirectory(scrypt) + target_sources(${TARGET} PRIVATE InputBuilder.cpp InputSimulator.cpp diff --git a/src/3rdparty/scrypt/CMakeLists.txt b/src/3rdparty/scrypt/CMakeLists.txt new file mode 100644 index 0000000..464466a --- /dev/null +++ b/src/3rdparty/scrypt/CMakeLists.txt @@ -0,0 +1,18 @@ +set(SCRYPT_WINDOWS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scrypt-windows) +set(SCRYPT_SOURCE_DIR ${SCRYPT_WINDOWS_DIR}/scrypt-1.1.6) + +target_sources(${SCRYPT_WINDOWS_LIB} PRIVATE + ${SCRYPT_SOURCE_DIR}/lib/crypto/crypto_scrypt-sse.c + ${SCRYPT_SOURCE_DIR}/lib/crypto/sha256.c + ${SCRYPT_WINDOWS_DIR}/win/mman.c +) +target_include_directories(${SCRYPT_WINDOWS_LIB} PRIVATE + ${SCRYPT_SOURCE_DIR} + ${SCRYPT_SOURCE_DIR}/lib/crypto + ${SCRYPT_SOURCE_DIR}/lib/scryptenc + ${SCRYPT_SOURCE_DIR}/lib/util +) + +target_include_directories(${TARGET} PRIVATE + ${SCRYPT_SOURCE_DIR}/lib +) diff --git a/src/3rdparty/scrypt/scrypt-windows b/src/3rdparty/scrypt/scrypt-windows new file mode 160000 index 0000000..043189e --- /dev/null +++ b/src/3rdparty/scrypt/scrypt-windows @@ -0,0 +1 @@ +Subproject commit 043189eb175298093e873aea14e84bcd468c2e38