2014-01-07 14:57:25 +04: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.
#------------------------------------------------------------------------------
2012-09-05 13:37:39 +04:00
set ( LLVM_LINK_COMPONENTS
b i t w r i t e r
2015-02-10 19:03:11 +03:00
m c j i t
o r c j i t
2014-03-28 19:45:34 +04:00
n a t i v e
o p t i o n
i p o
i n s t r u m e n t a t i o n
o b j c a r c o p t s
2012-09-05 13:37:39 +04:00
)
add_cling_library ( clingInterpreter
2013-03-01 20:22:32 +04:00
A u t o S y n t h e s i z e r . c p p
2014-06-08 01:52:32 +04:00
A u t o l o a d C a l l b a c k . c p p
2013-10-30 18:59:05 +04:00
C h e c k E m p t y T r a n s a c t i o n T r a n s f o r m e r . c p p
2012-09-05 13:37:39 +04:00
C I F a c t o r y . c p p
2013-09-20 14:01:10 +04:00
C l a n g I n t e r n a l S t a t e . c p p
2012-09-05 13:37:39 +04:00
D e c l C o l l e c t o r . c p p
D e c l E x t r a c t o r . c p p
2013-09-24 18:24:53 +04:00
D y n a m i c L i b r a r y M a n a g e r . c p p
2012-09-05 13:37:39 +04:00
D y n a m i c L o o k u p . c p p
D y n a m i c E x p r I n f o . c p p
2014-06-23 15:46:34 +04:00
F o r w a r d D e c l P r i n t e r . c p p
2014-02-19 15:49:24 +04:00
I n c r e m e n t a l E x e c u t o r . c p p
2015-02-10 19:03:11 +03:00
I n c r e m e n t a l J I T . c p p
2012-09-05 13:37:39 +04:00
I n c r e m e n t a l P a r s e r . c p p
I n t e r p r e t e r . c p p
2012-10-09 14:29:44 +04:00
I n t e r p r e t e r C a l l b a c k s . c p p
2012-09-05 13:37:39 +04:00
I n v o c a t i o n O p t i o n s . c p p
L o o k u p H e l p e r . c p p
2013-09-17 18:49:58 +04:00
N u l l D e r e f P r o t e c t i o n T r a n s f o r m e r . c p p
2012-11-02 12:11:24 +04:00
R e q u i r e d S y m b o l s . c p p
2014-02-18 20:57:47 +04:00
V a l u e E x t r a c t i o n S y n t h e s i z e r . c p p
2013-09-17 18:49:58 +04:00
R u n t i m e E x c e p t i o n . c p p
2012-09-05 13:37:39 +04:00
T r a n s a c t i o n . c p p
2012-10-26 17:21:09 +04:00
T r a n s a c t i o n T r a n s f o r m e r . c p p
2014-03-31 18:48:38 +04:00
T r a n s a c t i o n U n l o a d e r . c p p
2013-02-25 11:47:39 +04:00
V a l u e . c p p
2012-09-05 13:37:39 +04:00
V a l u e P r i n t e r . c p p
V a l u e P r i n t e r S y n t h e s i z e r . c p p
2014-03-08 16:16:06 +04:00
L I N K _ L I B S
c l a n g B a s i c
2014-06-23 15:46:34 +04:00
c l a n g A S T
2012-09-05 13:37:39 +04:00
)
2014-08-04 06:05:42 +04:00
2014-02-12 14:23:56 +04:00
if ( NOT WIN32 )
2013-09-17 18:49:58 +04:00
set_source_files_properties ( RuntimeException.cpp COMPILE_FLAGS -fexceptions )
2014-03-13 23:58:50 +04:00
endif ( )
2014-05-14 17:32:32 +04:00
set_source_files_properties ( Interpreter.cpp COMPILE_FLAGS -DCLING_VERSION=\\\ "${CLING_VERSION}\\\" )
2014-05-13 18:42:13 +04:00
2014-02-13 13:41:55 +04:00
#set_source_files_properties(RuntimeException.cpp COMPILE_FLAGS " /EHsc ")
# the line above doesn't work, and it gives the following warnings:
# cl : Command line warning D9025: overriding '/EHs' with '/EHs-'
# cl : Command line warning D9025: overriding '/EHc' with '/EHc-'
2014-03-13 23:58:50 +04:00
# so let's change the target compiler flags instead:
if ( MSVC )
get_target_property ( CI_COMPILE_FLAGS clingInterpreter COMPILE_FLAGS )
if ( ${ CI_COMPILE_FLAGS } )
string ( REPLACE "/EHs-c-" "" CI_COMPILE_FLAGS ${ CI_COMPILE_FLAGS } )
# add /EHsc exception handling flag
set ( CI_COMPILE_FLAGS "${CI_COMPILE_FLAGS} /EHsc" )
else ( )
set ( CI_COMPILE_FLAGS "/EHsc" )
endif ( )
set_target_properties ( clingInterpreter PROPERTIES
C O M P I L E _ F L A G S $ { C I _ C O M P I L E _ F L A G S } )
2014-02-12 14:23:56 +04:00
endif ( )
2012-09-05 13:37:39 +04:00
#add_dependencies(clangDriver ClangAttrList ClangDiagnosticDriver
# ClangDriverOptions ClangCC1Options ClangCC1AsOptions)
2014-01-14 19:14:18 +04:00
2014-08-08 20:48:24 +04:00
add_custom_command ( OUTPUT ${ CMAKE_CURRENT_BINARY_DIR } /cling-compiledata.h
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y _ i f _ d i f f e r e n t $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c l i n g - c o m p i l e d a t a . h . i n
$ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / c l i n g - c o m p i l e d a t a . h )
add_file_dependencies ( ${ CMAKE_CURRENT_SOURCE_DIR } /CIFactory.cpp ${ CMAKE_CURRENT_BINARY_DIR } /cling-compiledata.h )
add_file_dependencies ( ${ CMAKE_CURRENT_SOURCE_DIR } /Interpreter.cpp ${ CMAKE_CURRENT_BINARY_DIR } /cling-compiledata.h )
2014-01-14 19:14:18 +04:00
2014-02-10 13:35:34 +04:00
# Remove all -I from CMAKE_CXX_FLAGS
2014-02-10 18:25:18 +04:00
string ( REPLACE ";" " " __flags "${CMAKE_CXX_FLAGS}" )
string ( REGEX REPLACE "-I[^ ]+" "" CMAKE_CXX_FLAGS_NO_I "${__flags}" )
2014-02-10 13:35:34 +04:00
2014-04-09 20:12:57 +04:00
# Remove absolute path from CMAKE_CXX_COMPILER
get_filename_component ( _path ${ CMAKE_CXX_COMPILER } PATH )
get_filename_component ( _name ${ CMAKE_CXX_COMPILER } NAME )
if ( "$ENV{PATH}" MATCHES ${ _path } )
set ( CMAKE_CXX_COMPILER_RELATIVE ${ _name } )
else ( )
set ( CMAKE_CXX_COMPILER_RELATIVE ${ CMAKE_CXX_COMPILER } )
endif ( )
2014-08-08 20:48:24 +04:00
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /cling-compiledata.h.in
2014-04-09 20:12:57 +04:00
" #define LLVM_CXX \"${CMAKE_CXX_COMPILER_RELATIVE} ${CMAKE_CXX_FLAGS_NO_I} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}\"
2014-03-08 21:40:12 +04:00
"
)