@@ -75,55 +75,38 @@ else()
75
75
add_library (lualib SHARED ${LOCAL_SOURCES_H} ${LOCAL_SOURCES_C} )
76
76
set_property (TARGET lualib PROPERTY POSITION_INDEPENDENT_CODE ON )
77
77
endif ()
78
- add_library (lualib_static STATIC ${LOCAL_SOURCES_H} ${LOCAL_SOURCES_C} )
79
78
set_target_properties (lualib PROPERTIES LINKER_LANGUAGE C)
80
- set_target_properties (lualib_static PROPERTIES LINKER_LANGUAGE C)
81
79
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} " )
83
80
if (WIN32 )
84
81
set_target_properties (lualib PROPERTIES OUTPUT_NAME ${LUA_VERSION} )
85
82
install (TARGETS lualib DESTINATION "${CMAKE_INSTALL_PREFIX} " )
86
83
if (NOT LUA_STATIC)
87
84
install (FILES $<TARGET_PDB_FILE:lualib> DESTINATION "${CMAKE_INSTALL_PREFIX} " OPTIONAL )
88
85
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}")
93
86
else ()
94
87
set_target_properties (lualib PROPERTIES PUBLIC_HEADER "${LOCAL_SOURCES_H} ;${CMAKE_CURRENT_SOURCE_DIR} /lua.hpp" )
95
88
install (TARGETS lualib
96
89
DESTINATION "${CMAKE_INSTALL_PREFIX} /lib"
97
90
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX} /include"
98
91
)
99
- install (TARGETS lualib_static DESTINATION "${CMAKE_INSTALL_PREFIX} /lib" )
100
92
endif ()
101
93
if (WIN32 )
102
94
target_compile_definitions (lualib PRIVATE _CRT_SECURE_NO_WARNINGS)
103
- target_compile_definitions (lualib_static PRIVATE _CRT_SECURE_NO_WARNINGS)
104
95
if (NOT LUA_STATIC)
105
96
target_compile_definitions (lualib PRIVATE LUA_BUILD_AS_DLL)
106
97
endif ()
107
98
elseif (APPLE )
108
99
target_compile_definitions (lualib PUBLIC LUA_USE_MACOSX)
109
- target_compile_definitions (lualib_static PUBLIC LUA_USE_MACOSX)
110
100
target_compile_options (lualib PRIVATE -Wno-deprecated-declarations -Wno-empty-body)
111
- target_compile_options (lualib_static PRIVATE -Wno-deprecated-declarations -Wno-empty-body)
112
101
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)
116
102
elseif (UNIX )
117
103
target_compile_definitions (lualib PUBLIC LUA_USE_LINUX)
118
104
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)
121
105
set_target_properties (lualib PROPERTIES OUTPUT_NAME ${LUA_VERSION} )
122
- set_target_properties (lualib_static PROPERTIES OUTPUT_NAME ${LUA_VERSION} )
123
106
endif ()
124
107
125
108
#add_executable(lua_interpreter ${LUA_SOURCE_FOLDER}/lua.c)
126
- #target_link_libraries(lua_interpreter lualib_static )
109
+ #target_link_libraries(lua_interpreter lualib )
127
110
#target_compile_definitions(lua_interpreter PRIVATE _CRT_SECURE_NO_WARNINGS)
128
111
#set_target_properties(lua_interpreter PROPERTIES OUTPUT_NAME ${LUA_VERSION}_interpreter)
129
112
#if (WIN32)
@@ -140,7 +123,7 @@ endif()
140
123
#)
141
124
142
125
#add_executable(lua_compiler ${LUA_SOURCE_FOLDER}/luac.c)
143
- #target_link_libraries(lua_compiler lualib_static )
126
+ #target_link_libraries(lua_compiler lualib )
144
127
#target_compile_definitions(lua_compiler PRIVATE _CRT_SECURE_NO_WARNINGS)
145
128
#set_target_properties(lua_compiler PROPERTIES OUTPUT_NAME ${LUA_VERSION}_compiler)
146
129
#if (WIN32)
0 commit comments