mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
- Add FindTCL.cmake to fix FreeBSD detection
- Only call Tcl_CreateNamespace when available in the public API, fix compatibility with older release
This commit is contained in:
@@ -20,9 +20,14 @@ weechat-tcl-api.c weechat-tcl-api.h)
|
||||
SET_TARGET_PROPERTIES(tcl PROPERTIES PREFIX "")
|
||||
|
||||
IF(TCL_FOUND)
|
||||
SET(CMAKE_REQUIRED_INCLUDES "${TCL_INCLUDE_PATH}")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "${TCL_LIBRARY}")
|
||||
CHECK_SYMBOL_EXISTS(Tcl_CreateNamespace tcl.h HAVE_TCL_CREATE_NS)
|
||||
|
||||
INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH})
|
||||
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${TCL_LFLAGS}")
|
||||
TARGET_LINK_LIBRARIES(tcl ${TCL_LIBRARY} weechat_scripts)
|
||||
|
||||
ENDIF(TCL_FOUND)
|
||||
|
||||
INSTALL(TARGETS tcl LIBRARY DESTINATION lib/weechat/plugins)
|
||||
|
||||
@@ -4896,8 +4896,10 @@ void weechat_tcl_api_init (Tcl_Interp *interp) {
|
||||
/* standard initializer */
|
||||
Tcl_Init (interp);
|
||||
|
||||
#ifdef HAVE_TCL_CREATE_NS
|
||||
/* create weechat namespace */
|
||||
Tcl_CreateNamespace (interp, "weechat",(ClientData)0,NULL);
|
||||
#endif
|
||||
|
||||
/* interface constants */
|
||||
/* set variables, TODO: make them unmodifiable (thru Tcl_TraceVar) ? */
|
||||
|
||||
Reference in New Issue
Block a user