diff options
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 55bcd7d..d3ca6fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -36,9 +36,12 @@ set_target_properties(libyue PROPERTIES PREFIX "") | |||
36 | set_target_properties(libyue PROPERTIES OUTPUT_NAME "yue") | 36 | set_target_properties(libyue PROPERTIES OUTPUT_NAME "yue") |
37 | target_link_libraries(libyue ${LUA_LIBRARIES}) | 37 | target_link_libraries(libyue ${LUA_LIBRARIES}) |
38 | 38 | ||
39 | find_package(Threads REQUIRED) | ||
39 | add_executable(yue src/yuescript/ast.cpp src/yuescript/yue_compiler.cpp src/yuescript/yue_parser.cpp src/yuescript/yuescript.cpp src/yuescript/parser.cpp src/yue.cpp) | 40 | add_executable(yue src/yuescript/ast.cpp src/yuescript/yue_compiler.cpp src/yuescript/yue_parser.cpp src/yuescript/yuescript.cpp src/yuescript/parser.cpp src/yue.cpp) |
40 | target_link_libraries(yue ${LUA_LIBRARIES}) | 41 | target_link_libraries(yue ${LUA_LIBRARIES} Threads::Threads) |
41 | target_link_options(yue PRIVATE -ldl -lpthread) | 42 | if(CMAKE_DL_LIBS) |
43 | target_link_libraries(yue ${CMAKE_DL_LIBS}) | ||
44 | endif() | ||
42 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | 45 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") |
43 | target_link_options(yue PRIVATE -lstdc++fs) | 46 | target_link_options(yue PRIVATE -lstdc++fs) |
44 | endif() | 47 | endif() |