Skip to content

Build-system fixes#606

Merged
MarkCallow merged 2 commits intoKhronosGroup:masterfrom
pierremoreau:build_fixes
Jul 29, 2022
Merged

Build-system fixes#606
MarkCallow merged 2 commits intoKhronosGroup:masterfrom
pierremoreau:build_fixes

Conversation

@pierremoreau
Copy link
Copy Markdown
Contributor

  • Fix missing header when building toktx while KTX_FEATURE_VULKAN is disabled.
  • Do not build glloadtests and vkloadtests when their corresponding loader is not enabled, otherwise it results in missing symbols. For example, do not build vkloadtests when KTX_FEATURE_LOADTEST_APPS is enabled but KTX_FEATURE_VULKAN is not.

That path was being added to the include dirs of the library ktx only
when `KTX_FEATURE_VULKAN` was enabled, resulting in a build failure
otherwise:

```
    /home/pmoreau/Softwares/KTX-Software/tools/toktx/pngimage.cc:26:10: fatal error: 'dfd.h' file not found
    #include "dfd.h"
             ^~~~~~~
    1 error generated.
```
vkloadtests was still being built even if `KTX_FEATURE_VULKAN` was
disabled, resulting in missing symbols when loading against the ktx
library.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 28, 2022

CLA assistant check
All committers have signed the CLA.

@MarkCallow
Copy link
Copy Markdown
Collaborator

I see pngimage.cc includes dfd.h. How come it managed to be found when KTX_FEATURE_VULKAN was enabled?

@pierremoreau
Copy link
Copy Markdown
Contributor Author

I see pngimage.cc includes dfd.h. How come it managed to be found when KTX_FEATURE_VULKAN was enabled?

That is due to:

  1. The include directories for libktx being modified to include the following when KTX_FEATURE_VULKAN is enabled:
        target_include_directories(
            ${lib}
        PRIVATE
            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/lib/dfdutils>
            $<INSTALL_INTERFACE:lib/dfdutils>
        )
  2. And toktx adding the following to its own include directories:
    $<TARGET_PROPERTY:ktx,INCLUDE_DIRECTORIES>

@MarkCallow
Copy link
Copy Markdown
Collaborator

Thank you for the explanation and for this fix.

@MarkCallow MarkCallow merged commit 48bb42b into KhronosGroup:master Jul 29, 2022
@pierremoreau pierremoreau deleted the build_fixes branch July 29, 2022 11:42
@pierremoreau
Copy link
Copy Markdown
Contributor Author

No worries! Thank you for the quick replies and work on the project.

richgel999 pushed a commit to BinomialLLC/KTX-Software-Binomial-Fork that referenced this pull request Mar 9, 2026
* CMake: Add path to dfdutils headers for toktx

That path was being added to the include dirs of the library ktx only
when `KTX_FEATURE_VULKAN` was enabled, resulting in a build failure
otherwise:

```
    /home/pmoreau/Softwares/KTX-Software/tools/toktx/pngimage.cc:26:10: fatal error: 'dfd.h' file not found
    #include "dfd.h"
             ^~~~~~~
    1 error generated.
```

* CMake: Only build *loadtests if corresponding loader enabled

vkloadtests was still being built even if `KTX_FEATURE_VULKAN` was
disabled, resulting in missing symbols when loading against the ktx
library.
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.

3 participants