这是indexloc提供的服务,不要输入任何密码
Skip to content

check multiple highway headers #3642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 17, 2024
Merged

check multiple highway headers #3642

merged 7 commits into from
Jun 17, 2024

Conversation

mo271
Copy link
Member

@mo271 mo271 commented Jun 12, 2024

attempts to fix #3641

@dlemstra
Copy link
Contributor

Should this part also be changed:

find_path(HWY_INCLUDE_DIR
  NAMES hwy/highway.h
  HINTS ${PC_HWY_INCLUDEDIR} ${PC_HWY_INCLUDE_DIRS}
)

@mo271
Copy link
Member Author

mo271 commented Jun 12, 2024

Should this part also be changed:

find_path(HWY_INCLUDE_DIR
  NAMES hwy/highway.h
  HINTS ${PC_HWY_INCLUDEDIR} ${PC_HWY_INCLUDE_DIRS}
)

good point, added a mitigation for that

@dlemstra
Copy link
Contributor

Will test this later today.

@dlemstra
Copy link
Contributor

You should also do this:

if(NOT HWY_VERSION_MAJOR STREQUAL "" AND NOT HWY_VERSION_MINOR STREQUAL "" AND NOT HWY_VERSION_PATCH STREQUAL "")
  set(HWY_VERSION "${HWY_VERSION_MAJOR}.${HWY_VERSION_MINOR}.${HWY_VERSION_PATCH}")
endif()

Otherwise the value will be overwritten from the other header file. But when I use base-foo.h and and highway-foo it will then not set HWY_VERSION and continue without any errors. That can be fixed with:

if (HWY_INCLUDE_DIR AND NOT HWY_VERSION)
  set(HWY_VERSION "")

@mo271
Copy link
Member Author

mo271 commented Jun 12, 2024

You should also do this:

if(NOT HWY_VERSION_MAJOR STREQUAL "" AND NOT HWY_VERSION_MINOR STREQUAL "" AND NOT HWY_VERSION_PATCH STREQUAL "")
  set(HWY_VERSION "${HWY_VERSION_MAJOR}.${HWY_VERSION_MINOR}.${HWY_VERSION_PATCH}")
endif()

Make sense. I guess we could instead also break out of the foreach after setting this the first time

Otherwise the value will be overwritten from the other header file. But when I use base-foo.h and and highway-foo it will then not set HWY_VERSION and continue without any errors. That can be fixed with:

if (HWY_INCLUDE_DIR AND NOT HWY_VERSION)
  set(HWY_VERSION "")

I added this.
Thanks @dlemstra !

@mo271 mo271 added the CI:full Label to attach to a PR to run the full CI workflow and not just the regular PR workflows label Jun 12, 2024
@dlemstra
Copy link
Contributor

dlemstra commented Jun 12, 2024

Maybe a bit OCD but if (NOT looks better.

and yes I know I send it to you like this 😁

Copy link
Contributor

@dlemstra dlemstra left a comment

Choose a reason for hiding this comment

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

I can confirm that this fixes the issue.

@mo271 mo271 requested a review from sboukortt June 13, 2024 09:58
sboukortt
sboukortt previously approved these changes Jun 14, 2024
@mo271 mo271 enabled auto-merge June 17, 2024 11:33
@mo271 mo271 removed the CI:full Label to attach to a PR to run the full CI workflow and not just the regular PR workflows label Jun 17, 2024
@mo271 mo271 added this pull request to the merge queue Jun 17, 2024
Merged via the queue into libjxl:main with commit 784de18 Jun 17, 2024
196 of 197 checks passed
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.

FindHWY.cmake no longer works with the latest version of highway
3 participants