Skip to content

Commit

Permalink
Create binaries for sse2,avx,avx2 for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang98 committed Feb 24, 2024
1 parent 50be690 commit 496f3eb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/x86-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ jobs:
build:
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'

runs-on: windows-2022
strategy:
matrix:
architecture: ["sse2", "avx", "avx2" ]

steps:
- uses: actions/checkout@v3
Expand All @@ -48,7 +50,7 @@ jobs:
path: vcpkg

- name: Configure CMake
run: cmake . -B ${{env.BUILD_DIR}} --preset windows-msvc -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake
run: cmake . -B ${{env.BUILD_DIR}} --preset windows-msvc-${{matrix.architecture}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake

- name: Build
run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}}
Expand All @@ -65,5 +67,5 @@ jobs:
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: dab_radio_windows_x64
name: dab_radio_windows_x64_${{matrix.architecture}}
path: ${{github.workspace}}/${{env.PACKAGE_DIR}}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ imgui.ini
*.ini
*.log
logs.txt
dab_radio_windows_x64/
dab_radio_windows_x64.zip
dab_radio_windows_x64*/
dab_radio_windows_x64*.zip
.cache/
CMakeUserPresets.json
26 changes: 23 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,33 @@
"cacheVariables": {
"CMAKE_C_COMPILER": "cl",
"CMAKE_CXX_COMPILER": "cl",
"CMAKE_CXX_FLAGS_INIT": "/MP /fp:fast /arch:AVX2 /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING",
"CMAKE_C_FLAGS_INIT": "/MP /fp:fast /arch:AVX2 /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING"
"CMAKE_CXX_FLAGS_INIT": "/MP /fp:fast /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING",
"CMAKE_C_FLAGS_INIT": "/MP /fp:fast /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING"
}
},
{
"name": "windows-msvc-warnings",
"name": "windows-msvc-sse2",
"inherits": ["windows-msvc"]
},
{
"name": "windows-msvc-avx",
"inherits": ["windows-msvc"],
"cacheVariables": {
"CMAKE_CXX_FLAGS_INIT": "/arch:AVX /MP /fp:fast /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING",
"CMAKE_C_FLAGS_INIT": "/arch:AVX /MP /fp:fast /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING"
}
},
{
"name": "windows-msvc-avx2",
"inherits": ["windows-msvc"],
"cacheVariables": {
"CMAKE_CXX_FLAGS_INIT": "/arch:AVX2 /MP /fp:fast /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING",
"CMAKE_C_FLAGS_INIT": "/arch:AVX2 /MP /fp:fast /D_CRT_SECURE_NO_WARNINGS /D_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING"
}
},
{
"name": "windows-msvc-warnings",
"inherits": ["windows-msvc-avx2"],
"cacheVariables": {
"PROJECT_TARGET_PRIVATE_COMPILER_FLAGS": "/W3 /WX"
}
Expand Down
18 changes: 9 additions & 9 deletions toolchains/windows/create_package.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#!/bin/bash
output_dir="dab_radio_windows_x64"
build_dir="build-windows/examples"
PACKAGE_DIR="${PACKAGE_DIR:-dab_radio_windows_x64}"
BUILD_DIR="${BUILD_DIR:-build}"

# clean directory
rm -rf ${output_dir}
mkdir -p ${output_dir}
rm -rf ${PACKAGE_DIR}
mkdir -p ${PACKAGE_DIR}

# copy binaries
cp ${build_dir}/*.exe ${output_dir}/
cp ${build_dir}/*.dll ${output_dir}/
cp ${BUILD_DIR}/examples/*.exe ${PACKAGE_DIR}/
cp ${BUILD_DIR}/examples/*.dll ${PACKAGE_DIR}/

# copy resources
cp -rf res/ ${output_dir}/
cp -rf res/ ${PACKAGE_DIR}/

# copy imgui workspace files
cp *.ini ${output_dir}/
cp *.ini ${PACKAGE_DIR}/

# copy user docs
cp README.md ${output_dir}/
cp README.md ${PACKAGE_DIR}/

0 comments on commit 496f3eb

Please sign in to comment.