Skip to content

Commit fdf79cf

Browse files
committed
Remove unnecessary static Lua library project
1 parent 9cf5907 commit fdf79cf

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

dep/lualib/lua/CMakeLists.txt

+2-19
Original file line numberDiff line numberDiff line change
@@ -75,55 +75,38 @@ else()
7575
add_library(lualib SHARED ${LOCAL_SOURCES_H} ${LOCAL_SOURCES_C})
7676
set_property(TARGET lualib PROPERTY POSITION_INDEPENDENT_CODE ON)
7777
endif()
78-
add_library(lualib_static STATIC ${LOCAL_SOURCES_H} ${LOCAL_SOURCES_C})
7978
set_target_properties(lualib PROPERTIES LINKER_LANGUAGE C)
80-
set_target_properties(lualib_static PROPERTIES LINKER_LANGUAGE C)
8179
target_include_directories(lualib PUBLIC "${LUA_SOURCE_FOLDER}" "${CMAKE_CURRENT_SOURCE_DIR}")
82-
target_include_directories(lualib_static PUBLIC "${LUA_SOURCE_FOLDER}" "${CMAKE_CURRENT_SOURCE_DIR}")
8380
if (WIN32)
8481
set_target_properties(lualib PROPERTIES OUTPUT_NAME ${LUA_VERSION})
8582
install(TARGETS lualib DESTINATION "${CMAKE_INSTALL_PREFIX}")
8683
if (NOT LUA_STATIC)
8784
install(FILES $<TARGET_PDB_FILE:lualib> DESTINATION "${CMAKE_INSTALL_PREFIX}" OPTIONAL)
8885
endif()
89-
# set_target_properties(lualib PROPERTIES PUBLIC_HEADER "${LOCAL_SOURCES_H};${CMAKE_CURRENT_SOURCE_DIR}/lua.hpp")
90-
# install(TARGETS lualib PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
91-
# set_target_properties(lualib_static PROPERTIES OUTPUT_NAME ${LUA_VERSION}_static)
92-
# install(TARGETS lualib_static DESTINATION "${CMAKE_INSTALL_PREFIX}")
9386
else()
9487
set_target_properties(lualib PROPERTIES PUBLIC_HEADER "${LOCAL_SOURCES_H};${CMAKE_CURRENT_SOURCE_DIR}/lua.hpp")
9588
install(TARGETS lualib
9689
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
9790
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include"
9891
)
99-
install(TARGETS lualib_static DESTINATION "${CMAKE_INSTALL_PREFIX}/lib")
10092
endif()
10193
if (WIN32)
10294
target_compile_definitions(lualib PRIVATE _CRT_SECURE_NO_WARNINGS)
103-
target_compile_definitions(lualib_static PRIVATE _CRT_SECURE_NO_WARNINGS)
10495
if (NOT LUA_STATIC)
10596
target_compile_definitions(lualib PRIVATE LUA_BUILD_AS_DLL)
10697
endif()
10798
elseif (APPLE)
10899
target_compile_definitions(lualib PUBLIC LUA_USE_MACOSX)
109-
target_compile_definitions(lualib_static PUBLIC LUA_USE_MACOSX)
110100
target_compile_options(lualib PRIVATE -Wno-deprecated-declarations -Wno-empty-body)
111-
target_compile_options(lualib_static PRIVATE -Wno-deprecated-declarations -Wno-empty-body)
112101
target_link_libraries(lualib readline)
113-
target_link_libraries(lualib_static readline)
114-
# set_target_properties(lualib PROPERTIES COMPILE_FLAGS -undefined dynamic_lookup)
115-
# set_target_properties(lualib_static PROPERTIES COMPILE_FLAGS -undefined dynamic_lookup)
116102
elseif (UNIX)
117103
target_compile_definitions(lualib PUBLIC LUA_USE_LINUX)
118104
target_link_libraries(lualib ${CMAKE_DL_LIBS} m readline)
119-
target_compile_definitions(lualib_static PUBLIC LUA_USE_LINUX)
120-
target_link_libraries(lualib_static ${CMAKE_DL_LIBS} m readline)
121105
set_target_properties(lualib PROPERTIES OUTPUT_NAME ${LUA_VERSION})
122-
set_target_properties(lualib_static PROPERTIES OUTPUT_NAME ${LUA_VERSION})
123106
endif()
124107

125108
#add_executable(lua_interpreter ${LUA_SOURCE_FOLDER}/lua.c)
126-
#target_link_libraries(lua_interpreter lualib_static)
109+
#target_link_libraries(lua_interpreter lualib)
127110
#target_compile_definitions(lua_interpreter PRIVATE _CRT_SECURE_NO_WARNINGS)
128111
#set_target_properties(lua_interpreter PROPERTIES OUTPUT_NAME ${LUA_VERSION}_interpreter)
129112
#if (WIN32)
@@ -140,7 +123,7 @@ endif()
140123
#)
141124

142125
#add_executable(lua_compiler ${LUA_SOURCE_FOLDER}/luac.c)
143-
#target_link_libraries(lua_compiler lualib_static)
126+
#target_link_libraries(lua_compiler lualib)
144127
#target_compile_definitions(lua_compiler PRIVATE _CRT_SECURE_NO_WARNINGS)
145128
#set_target_properties(lua_compiler PROPERTIES OUTPUT_NAME ${LUA_VERSION}_compiler)
146129
#if (WIN32)

0 commit comments

Comments
 (0)