File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -23,18 +23,23 @@ add_feature_info(
2323
2424add_library (php_date OBJECT)
2525
26+ set (phpDateSources php_date.c)
27+
2628target_sources (
2729 php_date
2830 PRIVATE
29- php_date.c
31+ ${phpDateSources}
3032 php_date.stub.php
3133 PUBLIC
3234 FILE_SET HEADERS
3335 FILES
3436 php_date.h
3537)
3638
37- target_compile_definitions (php_date PRIVATE ZEND_ENABLE_STATIC_TSRMLS_CACHE)
39+ set_source_files_properties (
40+ ${phpDateSources}
41+ PROPERTIES COMPILE_DEFINITIONS ZEND_ENABLE_STATIC_TSRMLS_CACHE
42+ )
3843
3944target_compile_options (
4045 php_date
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ cmake_minimum_required(VERSION 3.25...3.31)
1717
1818project (Timelib LANGUAGES C)
1919
20+ include (CheckCompilerFlag)
2021include (CheckIncludeFile)
2122
2223if (NOT TIMELIB_TARGET)
@@ -64,6 +65,15 @@ target_compile_definitions(
6465 HAVE_STRTOLL
6566)
6667
68+ check_compiler_flag(C -fwrapv _HAVE_FWRAPV)
69+ if (_HAVE_FWRAPV)
70+ set_source_files_properties (
71+ ${timelibSources}
72+ TARGET_DIRECTORY ${TIMELIB_TARGET}
73+ PROPERTIES COMPILE_OPTIONS -fwrapv
74+ )
75+ endif ()
76+
6777check_include_file(io.h HAVE_IO_H)
6878
6979cmake_path(
You can’t perform that action at this time.
0 commit comments