2008-10-26 03:56:18 +03:00
|
|
|
macro(add_clang_library name)
|
2008-11-02 19:28:53 +03:00
|
|
|
set(srcs ${ARGN})
|
|
|
|
if(MSVC_IDE)
|
|
|
|
file( GLOB_RECURSE headers *.h)
|
|
|
|
set(srcs ${srcs} ${headers})
|
|
|
|
string( REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
list( GET split_path -1 dir)
|
|
|
|
file( GLOB_RECURSE headers ../../include/clang${dir}/*.h)
|
|
|
|
set(srcs ${srcs} ${headers})
|
|
|
|
endif(MSVC_IDE)
|
|
|
|
add_library( ${name} ${srcs} )
|
2008-10-26 03:56:18 +03:00
|
|
|
if( LLVM_COMMON_DEPENDS )
|
|
|
|
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
|
|
|
|
endif( LLVM_COMMON_DEPENDS )
|
2009-03-17 02:06:59 +03:00
|
|
|
add_dependencies(${name} ClangDiagnosticCommon)
|
2008-12-13 14:00:04 +03:00
|
|
|
if(MSVC)
|
|
|
|
get_target_property(cflag ${name} COMPILE_FLAGS)
|
|
|
|
if(NOT cflag)
|
|
|
|
set(cflag "")
|
|
|
|
endif(NOT cflag)
|
|
|
|
set(cflag "${cflag} /Za")
|
|
|
|
set_target_properties(${name} PROPERTIES COMPILE_FLAGS ${cflag})
|
|
|
|
endif(MSVC)
|
2008-10-26 03:56:18 +03:00
|
|
|
install(TARGETS ${name}
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib)
|
|
|
|
endmacro(add_clang_library)
|
|
|
|
|
|
|
|
macro(add_clang_executable name)
|
2008-11-02 19:28:53 +03:00
|
|
|
set(srcs ${ARGN})
|
|
|
|
if(MSVC_IDE)
|
|
|
|
file( GLOB_RECURSE headers *.h)
|
|
|
|
set(srcs ${srcs} ${headers})
|
|
|
|
endif(MSVC_IDE)
|
|
|
|
add_llvm_executable( ${name} ${srcs} )
|
2008-10-26 03:56:18 +03:00
|
|
|
install(TARGETS ${name}
|
|
|
|
RUNTIME DESTINATION bin)
|
|
|
|
endmacro(add_clang_executable)
|
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
2009-03-17 02:06:59 +03:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/include
|
2008-10-26 03:56:18 +03:00
|
|
|
)
|
|
|
|
|
2008-11-11 21:39:10 +03:00
|
|
|
install(DIRECTORY include
|
|
|
|
DESTINATION .
|
|
|
|
PATTERN ".svn" EXCLUDE
|
|
|
|
)
|
|
|
|
|
2008-10-26 03:56:18 +03:00
|
|
|
add_definitions( -D_GNU_SOURCE )
|
|
|
|
|
2009-03-17 02:06:59 +03:00
|
|
|
add_subdirectory(include)
|
2008-10-26 03:56:18 +03:00
|
|
|
add_subdirectory(lib)
|
|
|
|
add_subdirectory(Driver)
|
|
|
|
|
|
|
|
# TODO: docs.
|