Skip to content

Commit 99f57fe

Browse files
author
Florin Papa
committed
Add separate cmake file for setting OS variables
In the Options.cmake file, MAP_TEXT_HUGE_PAGES and ENABLE_FOLLY_SYMBOLIZER are set depending on the value of the LINUX variable, which is only set in a file included later - HPHPCompiler.cmake. This causes these 2 variables not to be visible in third-party modules the first time configure is run (subsequent times the variables are taken from the cmake cache). This change fixes this behavior by adding a new cmake file that sets the OS variables and including it before Options.cmake.
1 parent 34b65c7 commit 99f57fe

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

CMake/HPHPCompiler.cmake

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
set(FREEBSD FALSE)
2-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
3-
set(FREEBSD TRUE)
4-
endif()
5-
set(LINUX FALSE)
6-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
7-
set(LINUX TRUE)
8-
endif()
9-
set(DARWIN FALSE)
10-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
11-
set(DARWIN TRUE)
12-
endif()
13-
set(WINDOWS FALSE)
14-
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
15-
set(WINDOWS TRUE)
16-
endif()
17-
181
# Do this until cmake has a define for ARMv8
192
INCLUDE(CheckCXXSourceCompiles)
203
CHECK_CXX_SOURCE_COMPILES("

CMake/SetOSVars.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set(FREEBSD FALSE)
2+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
3+
set(FREEBSD TRUE)
4+
endif()
5+
set(LINUX FALSE)
6+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
7+
set(LINUX TRUE)
8+
endif()
9+
set(DARWIN FALSE)
10+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
11+
set(DARWIN TRUE)
12+
endif()
13+
set(WINDOWS FALSE)
14+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
15+
set(WINDOWS TRUE)
16+
endif()

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ SET(TP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third-party")
108108
SET(TP_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/third-party")
109109

110110
include(MSVCDefaults)
111+
include(SetOSVars)
111112
include(Options)
112113
include(HPHPCompiler)
113114
include(HPHPFindLibs)

0 commit comments

Comments
 (0)