4545 default : ' OFF'
4646
4747 # Windows-specific
48+ generator :
49+ type : string
50+ required : false
51+ default : ' Ninja'
4852 arch :
4953 type : string
5054 required : false
@@ -130,14 +134,20 @@ jobs:
130134 if : ${{ !inputs.use_run_on_arch }}
131135 shell : bash
132136 run : |
133- CMAKE_ARGS="-G Ninja -B build"
137+ CMAKE_ARGS="-G \"${{ inputs.generator }}\" -B build"
134138 CMAKE_ARGS="$CMAKE_ARGS -DADA_TESTING=${{ inputs.testing }}"
135139 CMAKE_ARGS="$CMAKE_ARGS -DADA_BENCHMARKS=${{ inputs.benchmarks }}"
136140 CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=${{ inputs.shared }}"
137141 CMAKE_ARGS="$CMAKE_ARGS -DADA_USE_SIMDUTF=${{ inputs.simdutf }}"
138- if [ -n "${{ inputs.build_type }}" ]; then
142+ # For multi-config generators (Visual Studio), don't set CMAKE_BUILD_TYPE
143+ # For single-config generators (Ninja, Make), set it
144+ if [[ "${{ inputs.generator }}" != *"Visual Studio"* ]] && [ -n "${{ inputs.build_type }}" ]; then
139145 CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=${{ inputs.build_type }}"
140146 fi
147+ # Visual Studio generator: add architecture
148+ if [ -n "${{ inputs.arch }}" ]; then
149+ CMAKE_ARGS="$CMAKE_ARGS -A ${{ inputs.arch }}"
150+ fi
141151 if [ -n "${{ inputs.toolchain_file }}" ]; then
142152 CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${{ inputs.toolchain_file }}"
143153 fi
@@ -151,14 +161,21 @@ jobs:
151161 export QEMU_CPU="${{ inputs.qemu_cpu }}"
152162 fi
153163 echo "Running: cmake $CMAKE_ARGS"
154- cmake $CMAKE_ARGS
164+ eval cmake $CMAKE_ARGS
155165 env :
156166 CXX : ${{ inputs.cxx }}
157167 CXXFLAGS : ${{ inputs.cxxflags }}
158168
159169 - name : Build
160170 if : ${{ !inputs.use_run_on_arch }}
161- run : cmake --build build -j=4
171+ shell : bash
172+ run : |
173+ BUILD_ARGS="--build build -j=4"
174+ # For multi-config generators (Visual Studio), specify config at build time
175+ if [[ "${{ inputs.generator }}" == *"Visual Studio"* ]] && [ -n "${{ inputs.build_type }}" ]; then
176+ BUILD_ARGS="$BUILD_ARGS --config ${{ inputs.build_type }}"
177+ fi
178+ cmake $BUILD_ARGS
162179
163180 - name : Test
164181 if : ${{ !inputs.use_run_on_arch && inputs.run_tests }}
@@ -170,7 +187,12 @@ jobs:
170187 if [ -n "${{ inputs.qemu_cpu }}" ]; then
171188 export QEMU_CPU="${{ inputs.qemu_cpu }}"
172189 fi
173- ctest --output-on-failure --test-dir build
190+ TEST_ARGS="--output-on-failure --test-dir build"
191+ # For multi-config generators (Visual Studio), specify config at test time
192+ if [[ "${{ inputs.generator }}" == *"Visual Studio"* ]] && [ -n "${{ inputs.build_type }}" ]; then
193+ TEST_ARGS="$TEST_ARGS -C ${{ inputs.build_type }}"
194+ fi
195+ ctest $TEST_ARGS
174196
175197 - name : Run benchmarks
176198 if : ${{ !inputs.use_run_on_arch && inputs.run_benchmarks }}
0 commit comments