Skip to content

Commit

Permalink
build: update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jmattaa committed Nov 24, 2024
1 parent 505596a commit 5931970
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
cmake_minimum_required(VERSION 3.14)
cmake_minimum_required(VERSION 3.18)

project(lsr LANGUAGES C)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG -fsanitize=address -Wall -Wextra -pedantic")
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")

find_package(Lua51 REQUIRED)

if(LUA_INCLUDE_DIR)
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}")
if (NOT LUA51_FOUND)
message(FATAL_ERROR "Lua5.1 libraries not found")
else()
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}")
message(STATUS "Lua libraries: ${LUA_LIBRARIES}")
endif()

if(NOT LUA_INCLUDE_DIR)
message(FATAL_ERROR "Lua headers not found")
else()
message(STATUS "Lua include directory: ${LUA_INCLUDE_DIR}")
endif()

include_directories("${LUA_INCLUDE_DIR}")
Expand Down

0 comments on commit 5931970

Please sign in to comment.