add libraries or else we can't link on OS X
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -118,10 +118,15 @@ add_executable(alive
"${CMAKE_BINARY_DIR}/tools/alive_lexer.cpp"
"tools/alive_parser.cpp"
)
-target_link_libraries(alive ${ALIVE_LIBS})
+target_link_libraries(alive PRIVATE ${ALIVE_LIBS})
add_library(alive2 SHARED ${IR_SRCS} ${SMT_SRCS} ${TOOLS_SRCS} ${UTIL_SRCS} ${LLVM_UTIL_SRCS})
+if (BUILD_LLVM_UTILS OR BUILD_TV)
+ llvm_map_components_to_libnames(llvm_libs support core irreader)
+ target_link_libraries(alive2 PRIVATE ${llvm_libs})
+endif()
+
if (CYGWIN)
# cmake on cygwin doesn't seem to know about dlls..
get_filename_component(Z3_LIB_DIR "${Z3_LIBRARIES}" DIRECTORY)
@@ -129,8 +134,8 @@ if (CYGWIN)
set(CMAKE_SHARED_LINKER_FLAGS "-L${Z3_LIB_DIR} -lz3")
file(COPY "${Z3_LIBRARIES}" DESTINATION "${PROJECT_BINARY_DIR}")
else()
- target_link_libraries(alive ${Z3_LIBRARIES})
- target_link_libraries(alive2 ${Z3_LIBRARIES})
+ target_link_libraries(alive PRIVATE ${Z3_LIBRARIES})
+ target_link_libraries(alive2 PRIVATE ${Z3_LIBRARIES})
endif()
if (BUILD_TV)

MODIFY
tv/CMakeLists.txt
tv/CMakeLists.txt
@@ -5,5 +5,5 @@ else()
add_llvm_library(tv MODULE tv.cpp)
endif()
-target_link_libraries(tv ${ALIVE_LIBS_LLVM} ${Z3_LIBRARIES}
+target_link_libraries(tv PRIVATE ${ALIVE_LIBS_LLVM} ${Z3_LIBRARIES}
$<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,9.0>>:stdc++fs>)

add libraries or else we can't link on OS X