Skip to content

Commit 0a58dd0

Browse files
committed
Remove CMAKE_INCLUDE_CURRENT_DIR setting
On Windows there is win32/time.h header which causes issues with this kind of configuration on MSVC because it seems that MSVC doesn't process include directories the same as GCC, Clang, and others, and loads the local file (time.h) first if the include flag is added. This is partial fix for this issue for now.
1 parent 909e9c9 commit 0a58dd0

File tree

6 files changed

+12
-772
lines changed

6 files changed

+12
-772
lines changed

cmake/cmake/CMakeDefaults.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ include_guard(GLOBAL)
1010
# Add paths where include() and find_package() look for modules.
1111
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules)
1212

13-
# Automatically include current source or build tree for the current target.
14-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
15-
1613
# Put the source or build tree include directories before other includes.
1714
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
1815

cmake/ext/fileinfo/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ target_compile_definitions(
113113
$<IF:$<BOOL:${HAVE_VISIBILITY}>,HAVE_VISIBILITY=1,HAVE_VISIBILITY=0>
114114
)
115115

116+
target_include_directories(php_ext_fileinfo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
117+
116118
set_property(
117119
SOURCE libmagic/apprentice.c
118120
APPEND

cmake/ext/intl/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ target_sources(
166166
uchar/uchar.stub.php
167167
)
168168

169+
target_include_directories(php_ext_intl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
170+
169171
php_check_compiler_flag(C -Wno-write-strings PHP_HAS_WNO_WRITE_STRINGS_C)
170172
if(PHP_HAS_WNO_WRITE_STRINGS_C)
171173
target_compile_options(

cmake/ext/opcache/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ if(PHP_EXT_OPCACHE_JIT)
154154
endif()
155155
endif()
156156

157+
target_include_directories(
158+
php_ext_opcache
159+
PRIVATE
160+
${CMAKE_CURRENT_SOURCE_DIR}
161+
${CMAKE_CURRENT_BINARY_DIR}
162+
)
163+
157164
if(PHP_EXT_OPCACHE_JIT)
158165
# Find out which ABI to use.
159166
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64|ARM64)$")

0 commit comments

Comments
 (0)