diff options
author | Li Jin <dragon-fly@qq.com> | 2021-01-11 14:53:31 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-01-11 14:53:31 +0800 |
commit | 6dc11dccc6c8147b5b71c86be7e458eebc35f8c5 (patch) | |
tree | 3ee6e603d1271b0525df2ab8ceddd71a9c47399c /CMakeLists.txt | |
parent | a191b6cd5ba938714203721e342e0af8c0ce569f (diff) | |
download | yuescript-6dc11dccc6c8147b5b71c86be7e458eebc35f8c5.tar.gz yuescript-6dc11dccc6c8147b5b71c86be7e458eebc35f8c5.tar.bz2 yuescript-6dc11dccc6c8147b5b71c86be7e458eebc35f8c5.zip |
add all the compiler specific linker flags.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7374e1c..1fcb248 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -26,7 +26,7 @@ MESSAGE(STATUS "Lua library: ${LUA_LIBRARIES}") | |||
26 | 26 | ||
27 | enable_language( CXX ) | 27 | enable_language( CXX ) |
28 | include_directories( src ${LUA_INCLUDE_DIR} ) | 28 | include_directories( src ${LUA_INCLUDE_DIR} ) |
29 | add_definitions( -std=c++17 -O3 -fPIC -lstdc++fs -ldl -Wno-unused-command-line-argument ) | 29 | add_definitions( -std=c++17 -O3 -fPIC ) |
30 | 30 | ||
31 | add_library( libmoonp MODULE src/MoonP/ast.cpp src/MoonP/parser.cpp src/MoonP/moon_parser.cpp src/MoonP/moon_compiler.cpp src/MoonP/moonplus.cpp) | 31 | add_library( libmoonp MODULE src/MoonP/ast.cpp src/MoonP/parser.cpp src/MoonP/moon_parser.cpp src/MoonP/moon_compiler.cpp src/MoonP/moonplus.cpp) |
32 | set_target_properties( libmoonp PROPERTIES PREFIX "" ) | 32 | set_target_properties( libmoonp PROPERTIES PREFIX "" ) |
@@ -35,6 +35,9 @@ target_link_libraries( libmoonp ${LUA_LIBRARIES} ) | |||
35 | 35 | ||
36 | add_executable( moonp src/MoonP/ast.cpp src/MoonP/moon_compiler.cpp src/MoonP/moon_parser.cpp src/MoonP/moonplus.cpp src/MoonP/parser.cpp src/moonp.cpp ) | 36 | add_executable( moonp src/MoonP/ast.cpp src/MoonP/moon_compiler.cpp src/MoonP/moon_parser.cpp src/MoonP/moonplus.cpp src/MoonP/parser.cpp src/moonp.cpp ) |
37 | target_link_libraries( moonp ${LUA_LIBRARIES} ) | 37 | target_link_libraries( moonp ${LUA_LIBRARIES} ) |
38 | if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
39 | target_link_options( moonp PRIVATE -ldl -lpthread -lstdc++fs ) | ||
40 | endif() | ||
38 | 41 | ||
39 | install(CODE "") | 42 | install(CODE "") |
40 | 43 | ||