Skip to content

Fix test dependencies#1970

Merged
keithw merged 2 commits intoWebAssembly:mainfrom
alexreinking:bugfix/1385
Aug 26, 2022
Merged

Fix test dependencies#1970
keithw merged 2 commits intoWebAssembly:mainfrom
alexreinking:bugfix/1385

Conversation

@alexreinking
Copy link
Contributor

This PR consists of two tightly related changes. It depends on #1968

1. Fix usage of Threads

find_package(Threads) was called redundantly and a bad check was used to disable a pthreads-specific test. Rather than checking WIN32, one should check CMAKE_USE_PTHREADS_INIT.

2. Only search for Python when BUILD_TESTS=ON

Rather than disable tests with a warning when Python cannot be found, require it when tests are enabled. Avoid the search altogether when tests are disabled.

This check additionally causes issues with FetchContent users that use the newer FindPython(3) module.

Fixes #1385

Rather than disable tests with a warning when Python cannot be found,
require it when tests are enabled. Avoid the search altogether when
tests are disabled.

This check additionally causes issues with FetchContent users that use
the newer FindPython(3) module.

Fixes #1385
find_package(Threads) was called redundantly and a bad check was used to
disable a pthreads-specific test. Rather than checking WIN32, one should
check CMAKE_USE_PTHREADS_INIT
Copy link
Member

@keithw keithw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@keithw keithw merged commit 0b83fe4 into WebAssembly:main Aug 26, 2022
@alexreinking
Copy link
Contributor Author

Thanks @keithw so much for all your time reviewing my PRs today!

matthias-blume pushed a commit to matthias-blume/wabt that referenced this pull request Dec 16, 2022
* Only search for Python when BUILD_TESTS=ON

Rather than disable tests with a warning when Python cannot be found,
require it when tests are enabled. Avoid the search altogether when
tests are disabled.

This check additionally causes issues with FetchContent users that use
the newer FindPython(3) module.

Fixes WebAssembly#1385

* Fix usage of Threads

find_package(Threads) was called redundantly and a bad check was used to
disable a pthreads-specific test. Rather than checking WIN32, one should
check CMAKE_USE_PTHREADS_INIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't require Python in build (if not found, skip those targets)

2 participants