# Copyright 2017 Jacob Lifshay # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # cmake_minimum_required(VERSION 3.3 FATAL_ERROR) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_POSITION_INDEPENDENT_CODE ON) project(kazan CXX C) if(NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") message(FATAL_ERROR "compiler is not clang") endif() if(NOT ${CMAKE_C_COMPILER_ID} MATCHES "Clang") message(FATAL_ERROR "compiler is not clang") endif() find_package(LLVM REQUIRED CONFIG) if(LLVM_PACKAGE_VERSION VERSION_LESS 4.0) message(FATAL_ERROR "unsupported version of llvm; requires version 4.0 or greater") endif() if(NOT LLVM_ENABLE_THREADS) message(FATAL_ERROR "llvm was not built multi-threaded") endif() include_directories(${LLVM_INCLUDE_DIRS}) add_definitions(${LLVM_DEFINITIONS}) set(CMAKE_THREAD_PREFER_PTHREAD 1) set(THREADS_PREFER_PTHREAD_FLAG 1) find_package(Threads REQUIRED) if(WIN32) add_definitions(NOMINMAX) endif() add_compile_options(-Wall -ftemplate-depth=1024 -Werror "-Wno-error=#warnings") add_subdirectory(src)