Skip to content

Commit

Permalink
Fix Windows DLL test configuration
Browse files Browse the repository at this point in the history
Enable Windows DLL test configuration.
Configure tests to pull in DLL dependencies using TARGET_RUNTIME_DLL_DIRS.
Bump cmake version to 3.27 to use TARGET_RUNTIME_DLL_DIRS.
Remove Ubuntu 20.04 test configuration.
  • Loading branch information
jeremy-lunarg committed Dec 10, 2024
1 parent a0995c4 commit 7d0aab0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 33 deletions.
34 changes: 2 additions & 32 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,35 +119,6 @@ jobs:
UBSAN_OPTIONS: 'halt_on_error=1:print_stacktrace=1'
run: ctest --output-on-failure --test-dir build

# Ensure we can compile/run on an older distro
linux_min:
name: Linux Backcompat
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.7'
- uses: lukka/get-cmake@71b7adfe2603f48bb9ed50d2b01a72499ae94885 # v3.31.0
with:
cmakeVersion: 3.17.2
- name: Setup ccache
uses: hendrikmuhs/ccache-action@ed74d11c0b343532753ecead8a951bb09bb34bc9 # v1.2.14
with:
key: linux_backcompat
- run: ./update_glslang_sources.py
- name: Configure
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D GLSLANG_TESTS=ON
env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
- name: Build
run: cmake --build build
- name: Install
run: cmake --install build --prefix build/install
- name: Test
run: ctest --output-on-failure --test-dir build

macos:
runs-on: ${{matrix.os}}
strategy:
Expand Down Expand Up @@ -231,9 +202,8 @@ jobs:
run: |
cmake -S. -Bbuild -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX="$PWD/build/install" -DBUILD_WERROR=ON -D GLSLANG_TESTS=ON -DBUILD_SHARED_LIBS=ON
cmake --build build --config ${{matrix.cmake_build_type}} --target install
# disabled until we figure out DLL issues.
# - name: Test
# run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build
- name: Test
run: ctest -C ${{matrix.cmake_build_type}} --output-on-failure --test-dir build

iOS:
runs-on: macos-13
Expand Down
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
cmake_minimum_required(VERSION 3.17.2)
cmake_minimum_required(VERSION 3.27)
project(glslang)

if (CMAKE_VERSION VERSION_LESS "3.21")
Expand Down Expand Up @@ -351,6 +351,13 @@ if(GLSLANG_TESTS)
add_test(NAME glslang-testsuite
COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Test/)

# Prepend paths to DLLs for Windows tests.
if(WIN32)
set_tests_properties(glslang-testsuite PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:glslang-standalone>,\;>")
set_tests_properties(glslang-testsuite PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:spirv-remap>,\;>")
endif()

endif(GLSLANG_TESTS)

if (GLSLANG_ENABLE_INSTALL)
Expand Down
5 changes: 5 additions & 0 deletions gtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,10 @@ if(GLSLANG_TESTS)

add_test(NAME glslang-gtests
COMMAND glslangtests --test-root "${GLSLANG_TEST_DIRECTORY}")

# Prepend paths to DLLs for Windows tests.
if(WIN32)
set_tests_properties(glslang-gtests PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<JOIN:$<TARGET_RUNTIME_DLL_DIRS:glslangtests>,\;>")
endif()
endif()
endif()

0 comments on commit 7d0aab0

Please sign in to comment.