Skip to content

Commit

Permalink
Link with math library on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslo committed Dec 6, 2015
1 parent 54d8461 commit 1054f9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ target_include_directories(lua_lib
PUBLIC src
)

include(CheckLibraryExists) # check_library_exists

# Some platforms (e.g. Linux) need separate math library
check_library_exists(m pow "" LIB_M_REQUIRED)
if(LIB_M_REQUIRED)
target_link_libraries(lua_lib PRIVATE m)
endif()

add_executable(lua src/lua.c)

target_link_libraries(lua lua_lib)
Expand Down

0 comments on commit 1054f9f

Please sign in to comment.