Commit 6034c288 authored by rmrf's avatar rmrf

Start cleaning up tests as well

parent 006fb5e1
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(systemc-clang) project(systemc-clang)
# Use C++ standard version to c++17 # Use C++ standard version to c++17
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
# Always keep it on # Always keep it on
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
option (USE_SAUTO option (USE_SAUTO
"Use suspension-automata library." OFF "Use suspension-automata library." OFF
) )
set (ROOT_CPP set (ROOT_CPP
driver-tooling.cpp driver-tooling.cpp
# ToolingTest.cpp # ToolingTest.cpp
# ToolingTutorial.cpp # ToolingTutorial.cpp
) )
# set (CLANG_SRC_DIR # set (CLANG_SRC_DIR
# $ENV{CLANG_SRC_DIR} # $ENV{CLANG_SRC_DIR}
...@@ -20,108 +20,107 @@ cmake_minimum_required(VERSION 2.6) ...@@ -20,108 +20,107 @@ cmake_minimum_required(VERSION 2.6)
# set (LLVM_SRC_DIR # set (LLVM_SRC_DIR
# $ENV{LLVM_SRC_DIR} # $ENV{LLVM_SRC_DIR}
# ) # )
set (LLVM_BUILD_DIR set (LLVM_BUILD_DIR
$ENV{LLVM_BUILD_DIR} $ENV{LLVM_BUILD_DIR}
) )
set (CMAKE_CXX_FLAGS set (CMAKE_CXX_FLAGS
"$ENV{LLVM_CXX_FLAGS} $ENV{CMAKE_CXX_FLAGS} -DUSE_SAUTO=off" "$ENV{LLVM_CXX_FLAGS} $ENV{CMAKE_CXX_FLAGS} -DUSE_SAUTO=off"
) )
if (USE_SAUTO) if (USE_SAUTO)
set (CMAKE_CXX_FLAGS set (CMAKE_CXX_FLAGS
"-DUSE_SAUTO=on ${CMAKE_CXX_FLAGS}" "-DUSE_SAUTO=on ${CMAKE_CXX_FLAGS}"
) )
endif(USE_SAUTO) endif(USE_SAUTO)
set (LLVM_LD_FLAGS set (LLVM_LD_FLAGS
"$ENV{LLVM_LD_FLAGS} -lpthread" "$ENV{LLVM_LD_FLAGS} -lpthread"
) )
set (LLVM_LIBS set (LLVM_LIBS
$ENV{LLVM_LIBS} $ENV{LLVM_LIBS}
) )
#set (LLVM_LD_LIBS LLVMCppBackendCodeGen LLVMCppBackendInfo LLVMTarget LLVMCore LLVMMC LLVMObject LLVMSupport) #set (LLVM_LD_LIBS LLVMCppBackendCodeGen LLVMCppBackendInfo LLVMTarget LLVMCore LLVMMC LLVMObject LLVMSupport)
#LLVMJIT LLVMX86CodeGen LLVMX86AsmParser LLVMX86Disassembler LLVMExecutionEngine LLVMAsmPrinter LLVMSelectionDAG LLVMX86AsmPrinter LLVMX86Info LLVMMCParser LLVMCodeGen LLVMX86Utils LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMTarget LLVMCore LLVMMC LLVMSupport #LLVMJIT LLVMX86CodeGen LLVMX86AsmParser LLVMX86Disassembler LLVMExecutionEngine LLVMAsmPrinter LLVMSelectionDAG LLVMX86AsmPrinter LLVMX86Info LLVMMCParser LLVMCodeGen LLVMX86Utils LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMTarget LLVMCore LLVMMC LLVMSupport
set (CLANG_LIBS set (CLANG_LIBS
clangTooling clangTooling
clangFrontendTool clangFrontendTool
clangFrontend clangFrontend
clangDriver clangDriver
clangSerialization clangSerialization
clangCodeGen clangCodeGen
clangParse clangParse
clangSema clangSema
clangStaticAnalyzerFrontend clangStaticAnalyzerFrontend
clangStaticAnalyzerCheckers clangStaticAnalyzerCheckers
clangStaticAnalyzerCore clangStaticAnalyzerCore
clangAnalysis clangAnalysis
clangARCMigrate clangARCMigrate
clangRewriteFrontend clangRewriteFrontend
clangRewrite clangRewrite
clangEdit clangEdit
clangAST clangAST
clangLex clangLex
clangBasic clangBasic
clangASTMatchers clangASTMatchers
) )
set (CMAKE_MODULE_LINKER_FLAGS set (CMAKE_MODULE_LINKER_FLAGS
$ENV{LLVM_LD_FLAGS} $ENV{LLVM_LD_FLAGS}
) )
set (TARGET set (TARGET
"systemc-clang" "systemc-clang"
) )
include_directories( include_directories(
"${LLVM_BUILD_DIR}/include" "${LLVM_BUILD_DIR}/include"
src src
if (USE_SAUTO) if (USE_SAUTO)
sauto sauto
endif (USE_SAUTO) endif (USE_SAUTO)
) )
link_directories( link_directories(
${LLVM_BUILD_DIR}/lib ${LLVM_BUILD_DIR}/lib
) )
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(src)
if (USE_SAUTO) if (USE_SAUTO)
add_subdirectory(sauto) add_subdirectory(sauto)
endif (USE_SAUTO) endif (USE_SAUTO)
set( SRC_LIB libsystemc-clang) set( SRC_LIB libsystemc-clang )
if (USE_SAUTO) if (USE_SAUTO)
set( SAUTO_LIB libsauto ) set( SAUTO_LIB libsauto )
endif (USE_SAUTO) endif (USE_SAUTO)
add_executable( add_executable(
${TARGET} ${TARGET}
${ROOT_CPP} ) ${ROOT_CPP} )
target_link_libraries(${TARGET} ${SRC_LIB})
target_link_libraries(${TARGET} ${SAUTO_LIB})
foreach (clang_lib ${CLANG_LIBS})
target_link_libraries( ${TARGET} ${clang_lib} )
endforeach()
foreach (ld_flag ${LLVM_LD_FLAGS})
target_link_libraries( ${TARGET} ${ld_flag} )
endforeach()
foreach (llvm_lib ${LLVM_LIBS}) target_link_libraries(${TARGET} ${SRC_LIB})
target_link_libraries( ${TARGET} ${llvm_lib} ) target_link_libraries(${TARGET} ${SAUTO_LIB})
endforeach()
foreach (clang_lib ${CLANG_LIBS})
target_link_libraries( ${TARGET} ${clang_lib} )
endforeach()
foreach (ld_flag ${LLVM_LD_FLAGS})
target_link_libraries( ${TARGET} ${ld_flag} )
endforeach()
foreach (llvm_lib ${LLVM_LIBS})
target_link_libraries( ${TARGET} ${llvm_lib} )
endforeach()
...@@ -50,7 +50,7 @@ using namespace clang::tooling; ...@@ -50,7 +50,7 @@ using namespace clang::tooling;
#include "SCuitable/GlobalSuspensionAutomata.h" #include "SCuitable/GlobalSuspensionAutomata.h"
#include "SuspensionAutomata.h" #include "SuspensionAutomata.h"
#include "Utility.h" #include "Utility.h"
#include "FindTemplateParameters.h" \ #include "FindTemplateParameters.h"
using namespace clang; using namespace clang;
......