Skip to content

Commit 32223d4

Browse files
committed
Configure languages in the top-level CMakeLists.txt
On some platforms, enabling languages in a subproject or via FetchContent module, doesn't work ok, so these must be (for now, at least) enabled (also) in the top-level CMakeLists.txt.
1 parent 30b7d7d commit 32223d4

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

CMakeLists.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,31 @@ project(
7272
VERSION 8.3
7373
DESCRIPTION "CMake-based PHP build system"
7474
HOMEPAGE_URL "https://github.com/petk/php-build-system"
75-
LANGUAGES NONE
75+
LANGUAGES C
7676
)
7777

78+
################################################################################
79+
# Configure languages.
80+
################################################################################
81+
82+
# Optionally enable C++ language for PHP extensions.
83+
include(CheckLanguage)
84+
check_language(CXX)
85+
if(CMAKE_CXX_COMPILER)
86+
enable_language(CXX)
87+
endif()
88+
89+
# Enable Assembly language dialect.
90+
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
91+
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^ARM")
92+
enable_language(ASM_MARMASM)
93+
else()
94+
enable_language(ASM_MASM)
95+
endif()
96+
else()
97+
enable_language(ASM)
98+
endif()
99+
78100
# Configuration.
79101
block(PROPAGATE phpUrl)
80102
set(

0 commit comments

Comments
 (0)