-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lua] Fix library type and usage (#24436)
* [lua] Fix library type and usage * version * Use c code in executables * version * Apply suggestion * version * Add an extra CMakeLists.txt to avoid scope pollution of SET_SOURCE_FILES_PROPERTIES * version * Apply suggestions * version * Various nitpicks: * Use "supports" on features rather than if tests plus message FATAL_ERROR * Deduplicate ENABLE_LUA_CPP and COMPILE_AS_CPP * Add quotes. * Use file(INSTALL rather than configure_file(COPYONLY) Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
- Loading branch information
1 parent
ad06b4e
commit 32d25e6
Showing
7 changed files
with
69 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
SET(SRC_LIBLUACPP ${SRC_LIBLUA}) | ||
ADD_LIBRARY ( lua-cpp ${SRC_LIBLUACPP} ${HDR_LIBLUACPP} ) | ||
SET_TARGET_PROPERTIES(lua-cpp PROPERTIES OUTPUT_NAME "lua-c++") | ||
SET_SOURCE_FILES_PROPERTIES(${SRC_LIBLUACPP} PROPERTIES LANGUAGE CXX) | ||
TARGET_INCLUDE_DIRECTORIES(lua-cpp PRIVATE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> PUBLIC $<INSTALL_INTERFACE:include>) | ||
IF (BUILD_SHARED_LIBS AND WIN32) | ||
TARGET_COMPILE_DEFINITIONS (lua-cpp PUBLIC -DLUA_BUILD_AS_DLL ) | ||
ENDIF () | ||
IF (UNIX) | ||
IF (APPLE) | ||
TARGET_COMPILE_DEFINITIONS (lua-cpp PUBLIC -DLUA_USE_DLOPEN) | ||
ELSE () | ||
FIND_LIBRARY (LIB_DLOPEN NAMES dl) | ||
IF (LIB_DLOPEN) | ||
TARGET_COMPILE_DEFINITIONS (lua-cpp PUBLIC -DLUA_USE_DLOPEN) | ||
TARGET_LINK_LIBRARIES (lua-cpp ${LIB_DLOPEN}) | ||
ENDIF () | ||
ENDIF () | ||
ENDIF () | ||
|
||
INSTALL ( TARGETS lua-cpp | ||
EXPORT unofficial-lua-cpp-config | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib | ||
) | ||
|
||
INSTALL(EXPORT unofficial-lua-cpp-config DESTINATION share/unofficial-lua-cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters