Skip to content

Commit 5d2e74f

Browse files
littledivysaghul
authored andcommitted
Add -DBUILD_QJS_LIBC option
1 parent ea068d9 commit 5d2e74f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ endif()
118118
# QuickJS library
119119
#
120120

121+
xoption(BUILD_QJS_LIBC "Build standard library modules as part of the library" OFF)
122+
121123
set(qjs_sources
122124
cutils.c
123125
libbf.c
@@ -126,6 +128,9 @@ set(qjs_sources
126128
quickjs.c
127129
)
128130

131+
if(BUILD_QJS_LIBC)
132+
list(APPEND qjs_sources quickjs-libc.c)
133+
endif()
129134
list(APPEND qjs_defines _GNU_SOURCE)
130135
list(APPEND qjs_libs qjs m pthread)
131136
if(NOT MINGW)
@@ -299,6 +304,9 @@ set_target_properties(qjs PROPERTIES
299304
SOVERSION ${QJS_VERSION_MAJOR}
300305
)
301306
install(FILES quickjs.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
307+
if(BUILD_QJS_LIBC)
308+
install(FILES quickjs-libc.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
309+
endif()
302310
install(TARGETS qjs_exe RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
303311
install(TARGETS qjs EXPORT qjsConfig
304312
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

0 commit comments

Comments
 (0)