forked from AcademySoftwareFoundation/OpenImageIO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Use target_compile_options (fixes a LibRaw build issue) (Acade…
…mySoftwareFoundation#4556) When using pkgconfig the value of `<NAME>_CFLAGS_OTHER` can contain compiler flags along with preprocessor definitions. If there is a compiler flag and its passed to `target_compile_definitions` then it will be treated as if it is a preprocessor definition. Found a case where a statically compiled LibRaw with a statically compiled Little-CMS caused `LibRaw_DEFINITIONS` to have `-pthread` in its listing which was passed to the compiler as a definition, `-D-pthread`. This caused a build failure with `auto-moc`. Add an additional parameter for the `add_oiio_plugin` macro to take `COMPILE_OPTIONS` and pass those to `target_compile_options` which can differentiate between compiler flags and preprocessor definitions. Pass `LibRaw_DEFINITIONS` to the CMake macro to prevent the above error. Issue found while updating Little-CMS in microsoft/vcpkg#42187 and the change fixes the build issue found there. This is an attempt to upstream it so the issue is fixed. Signed-off-by: Don Olmstead <don.j.olmstead@gmail.com>
- Loading branch information
1 parent
4b56b81
commit d59b5dc
Showing
3 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters