cling/tools/demo/CMakeLists.txt

47 lines
1.6 KiB
CMake
Raw Normal View History

2017-03-20 01:03:53 +03:00
#------------------------------------------------------------------------------
# CLING - the C++ LLVM-based InterpreterG :)
#
# This file is dual-licensed: you can choose to license it under the University
# of Illinois Open Source License or the GNU Lesser General Public License. See
# LICENSE.TXT for details.
#------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.5)
2017-06-19 16:43:00 +03:00
# Keep symbols for JIT resolution
set(LLVM_NO_DEAD_STRIP 1)
2017-03-20 17:27:07 +03:00
# Cling needs at least C++11; so does this demo.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2017-03-20 17:27:07 +03:00
if (CMAKE_PROJECT_NAME)
# Building as part of cling; all CMake variables are set.
else()
# Building as separate project.
project(cling-demo)
2017-03-20 17:27:07 +03:00
# This project needs cling.
find_package(cling REQUIRED)
endif()
2017-03-20 17:27:07 +03:00
# The project has one binary:
add_executable(cling-demo cling-demo.cpp)
2017-03-20 17:27:07 +03:00
# ...which links against clingInterpreter (and its dependencies).
target_link_libraries(cling-demo clingInterpreter)
# Provide LLVMDIR to cling-demp.cpp:
target_compile_options(cling-demo PUBLIC -DLLVMDIR="${LLVM_INSTALL_PREFIX}" -I${LLVM_INSTALL_PREFIX}/include)
2017-06-19 16:43:00 +03:00
set_target_properties(cling-demo
PROPERTIES ENABLE_EXPORTS 1)
if(MSVC)
set_target_properties(cling-demo PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)
set_property(TARGET cling-demo APPEND_STRING PROPERTY LINK_FLAGS
"/EXPORT:?setValueNoAlloc@internal@runtime@cling@@YAXPEAX00D_K@Z
/EXPORT:?setValueNoAlloc@internal@runtime@cling@@YAXPEAX00DM@Z
/EXPORT:cling_runtime_internal_throwIfInvalidPointer")
endif()