From 1a40e539d1606afad99ab59a8cb44aef7c35be5d Mon Sep 17 00:00:00 2001 From: yhirose Date: Fri, 24 Jan 2020 22:54:03 -0500 Subject: [PATCH] Updated cmake files --- CMakeLists.txt | 5 +++++ example/CMakeLists.txt | 2 ++ lint/CMakeLists.txt | 1 + pl0/CMakeLists.txt | 15 +++++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 pl0/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 4eabf7f..3f67770 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,3 +57,8 @@ enable_testing() add_subdirectory(test) add_subdirectory(example) add_subdirectory(lint) + +find_package(LLVM CONFIG) +if(LLVM_FOUND) + add_subdirectory(pl0) +endif() diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 84aff73..3703aae 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,4 +1,6 @@ cmake_minimum_required(VERSION 2.8) +project(example) + include_directories(..) if(MSVC) diff --git a/lint/CMakeLists.txt b/lint/CMakeLists.txt index 3c434fd..1ddf9a2 100644 --- a/lint/CMakeLists.txt +++ b/lint/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.8) +project(peglint) include_directories(..) add_definitions("-std=c++11") add_executable(peglint peglint.cc) diff --git a/pl0/CMakeLists.txt b/pl0/CMakeLists.txt new file mode 100644 index 0000000..8485819 --- /dev/null +++ b/pl0/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.1) +project(tcp) + +enable_language(CXX) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_EXTENSIONS OFF) + +include_directories(..) +add_executable(pl0 pl0.cc) + +find_package(LLVM REQUIRED CONFIG) +set(add_link_deps ${add_link_deps} LLVM) +target_include_directories(pl0 PUBLIC ${LLVM_INCLUDE_DIRS}) +target_link_libraries(pl0 ${add_link_deps})