Skip to content

Commit

Permalink
cmakeList 编译出lua
Browse files Browse the repository at this point in the history
  • Loading branch information
huahua132 committed Nov 16, 2024
1 parent 216c4b7 commit a912229
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
aux_source_directory(win3rd/posix POSIX_SRC)
add_subdirectory(win3rd/pthread-win32)
add_library(liblua SHARED ${LUA_LIB_SRC})

target_include_directories(liblua PRIVATE skynet/skynet-src)
add_library(libposix SHARED ${POSIX_SRC})
target_compile_definitions(libposix PRIVATE POSIX_LIBRARY)
Expand All @@ -53,6 +54,17 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
add_executable(skynet skynet/skynet-src/skynet_main.c)
target_link_libraries(skynet ws2_32 liblua libposix libskynet pthreadVC3)

# 重新设置动态库输出路径
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/skynet/3rd/lua)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/skynet/3rd/lua)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
# 编译 lua 可执行文件
add_executable(lua skynet/3rd/lua/lua.c)
add_library(lualibb SHARED ${LUA_LIB_SRC})
target_include_directories(lualibb PRIVATE skynet/skynet-src)
target_link_libraries(lua lualibb)

# 重新设置动态库输出路径
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/skynet/luaclib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
Expand Down
Empty file removed win3rd/openssl/lib/linux/.gitkeep
Empty file.
Binary file removed win3rd/openssl/lib/linux/libcrypto.a
Binary file not shown.
Binary file removed win3rd/openssl/lib/linux/libssl.a
Binary file not shown.
Empty file removed win3rd/openssl/lib/mac/.gitkeep
Empty file.
Binary file removed win3rd/openssl/lib/mac/libcrypto.a
Binary file not shown.
Binary file removed win3rd/openssl/lib/mac/libssl.a
Binary file not shown.

0 comments on commit a912229

Please sign in to comment.