After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773659 - Don't set CFLAGS returned by pkg-config as CMAKE_REQUIRED_FLAGS
Don't set CFLAGS returned by pkg-config as CMAKE_REQUIRED_FLAGS
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
3.23.x (obsolete)
Other FreeBSD
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2016-10-29 05:14 UTC by Ting-Wei Lan
Modified: 2016-10-31 17:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug 773659 - Don't set CFLAGS returned by pkg-config as CMAKE_REQUIRED_FLAGS (2.00 KB, patch)
2016-10-29 05:15 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2016-10-29 05:14:45 UTC
It seems that specifying -D arguments is not allowed in CMAKE_REQUIRED_FLAGS when using CHECK_C_SOURCE_COMPILES. Please see the attached patch that avoids the problem.
Comment 1 Ting-Wei Lan 2016-10-29 05:15:27 UTC
Created attachment 338768 [details] [review]
Bug 773659 - Don't set CFLAGS returned by pkg-config as CMAKE_REQUIRED_FLAGS

When CFLAGS returned by pkg-config contains -D arguments, it may cause
check to fail with internal error:

-- Performing Test HAVE_ICAL_UNKNOWN_TOKEN_HANDLING
Parse error in command line argument: -D_THREAD_SAFE
Should be: VAR:type=value
CMake Error: No cmake script provided.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test HAVE_ICAL_UNKNOWN_TOKEN_HANDLING - Failed
-- Performing Test HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT
Parse error in command line argument: -D_THREAD_SAFE
Should be: VAR:type=value
CMake Error: No cmake script provided.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Performing Test HAVE_ICALTZUTIL_SET_EXACT_VTIMEZONES_SUPPORT - Failed

To avoid the issue, we use CMAKE_REQUIRED_DEFINITIONS to set flags other
than -I. _CFLAGS_OTHER is used instead of _CFLAGS because -I arguments
are already added by using _INCLUDE_DIRS and CMAKE_REQUIRED_INCLUDES.
Comment 2 Milan Crha 2016-10-31 14:48:27 UTC
Thanks for a bug report and patch. Why did it fail here, but not in the eds?

https://git.gnome.org/browse/evolution-data-server/tree/CMakeLists.txt#n857

I suppose due to other module defining that -D_THREAD_SAFE, one which is not part of CALENDAR, but is part of EVOLUTION_DATA_SERVER modules. I'll use the same approach in the eds too, to be consistent.
Comment 3 Milan Crha 2016-10-31 15:03:02 UTC
And also evolution-mapi, where I fixed one other typo in the script.

Created commit_27b477f in eds master (3.23.2+) [1]
Created commit 37eac9c in evo master (3.23.2+)
Created commit_2d03ed5 in ema master (3.23.2+) [2]

[1] https://git.gnome.org/browse/evolution-data-server/commit/?id=27b477f
[2] https://git.gnome.org/browse/evolution-mapi/commit/?id=2d03ed5
Comment 4 Ting-Wei Lan 2016-10-31 17:04:16 UTC
(In reply to Milan Crha from comment #2)
> Thanks for a bug report and patch. Why did it fail here, but not in the eds?
> 
> https://git.gnome.org/browse/evolution-data-server/tree/CMakeLists.txt#n857
> 
> I suppose due to other module defining that -D_THREAD_SAFE, one which is not
> part of CALENDAR, but is part of EVOLUTION_DATA_SERVER modules. I'll use the
> same approach in the eds too, to be consistent.

-D_THREAD_SAFE get added when running 'pkg-config --cflags libedataserverui-1.2'. I think it probably comes from x11.pc.