-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
315 additions
and
0 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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |
Empty file.
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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |
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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |
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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |
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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |
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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |
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,45 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
# Project name | ||
project(hash LANGUAGES C) | ||
|
||
# Find Lua | ||
find_package(Lua51 REQUIRED) | ||
|
||
include_directories(${LUA_INCLUDE_DIR}) | ||
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}") | ||
|
||
# Add the MD5 source file | ||
file(GLOB SOURCES ./src/**.c) | ||
SET(hash ${SOURCES}) | ||
|
||
# Create the shared library | ||
add_library(hash SHARED ${SOURCES}) | ||
|
||
# Specify the output name of the shared library | ||
# set_target_properties(hash PROPERTIES OUTPUT_NAME "hash") | ||
# Set the prefix for shared libraries to an empty string | ||
set(CMAKE_SHARED_LIBRARY_PREFIX "") | ||
|
||
# Set C standards | ||
set_target_properties(hash PROPERTIES | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED YES | ||
) | ||
|
||
# Link the library with Lua | ||
# target_link_libraries(hash PRIVATE Lua51::Lua) | ||
target_link_libraries(hash PRIVATE ${LUA_LIBRARIES}) | ||
|
||
# 获取当前目录的完整路径 | ||
get_filename_component(CURRENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ABSOLUTE) | ||
|
||
# 创建一个包含路径的字符串 | ||
set(CPATH_CONTENT "return \"${CURRENT_DIR}/hash.so\"") | ||
|
||
# 将内容写入 cpath.lua 文件 | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua.in | ||
${CMAKE_CURRENT_SOURCE_DIR}/cpath.lua | ||
@ONLY | ||
) |