Created
August 29, 2021 16:39
-
-
Save hulefei/86113cfcae20ad28febd9a4459128ee7 to your computer and use it in GitHub Desktop.
cmake for lua soruce
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
cmake_minimum_required(VERSION 3.6) | |
GET_FILENAME_COMPONENT(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) | |
project(${PROJECT_NAME}) | |
#message(${PROJECT_NAME}) | |
AUX_SOURCE_DIRECTORY(. ALL_SRC) | |
INCLUDE_DIRECTORIES(.) | |
# remove the lua.c/luac.c from teh all file lists | |
SET(LIB_SRC ${ALL_SRC}) | |
LIST(REMOVE_ITEM LIB_SRC lua.c luac.c) | |
ADD_LIBRARY(lua ${LIB_SRC}) | |
ADD_EXECUTABLE(luaexec lua.c) | |
target_link_libraries(luaexec lua) | |
set_target_properties(luaexec PROPERTIES OUTPUT_NAME lua) | |
add_executable(luac luac.c) | |
target_link_libraries(luac lua) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment