Skip to content

Commit ba73b60

Browse files
committed
fix: explicit link libm only on non-windows platforms (#17)
1 parent 866bdd9 commit ba73b60

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

CMakeLists.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,17 @@ set (LUAC
9494
${LUA_SRC}/luac.c
9595
)
9696

97-
include(CheckLibraryExists)
98-
check_library_exists(m pow "" LIBEXISTS)
99-
if(LIBEXISTS)
100-
set(LIBM "m")
101-
endif()
102-
10397
add_executable(lua ${LUA} ${LIB})
104-
target_link_libraries(lua PUBLIC ${LIBM})
105-
10698
add_executable(luac ${LUAC} ${LIB})
107-
target_link_libraries(luac PUBLIC ${LIBM})
99+
100+
if(NOT WIN32)
101+
include(CheckLibraryExists)
102+
check_library_exists(m pow "" LIBEXISTS)
103+
if(LIBEXISTS)
104+
target_link_libraries(lua PUBLIC m)
105+
target_link_libraries(luac PUBLIC m)
106+
endif()
107+
endif()
108108

109109
add_library(lualib SHARED ${LIB})
110110
target_sources(lualib

0 commit comments

Comments
 (0)