-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
100 lines (85 loc) · 2.47 KB
/
CMakeLists.txt
File metadata and controls
100 lines (85 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
IF ("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
#add_definitions( -Ddebugging )
#set( EXTRA_YACC_FLAGS "-Wall" ) #-Wall introduced somewhere between bison v2.3 and v2.4.1
#This graph is HUGE! dot takes a very long time, so does loading it in a viewer
#enable with -DBISON_GRAPH=TRUE
if( BISON_GRAPH )
message("Bison will create a graph of the scanner flow at ${SCL_BINARY_DIR}/expparse.dot")
set( EXTRA_YACC_FLAGS "${EXTRA_YACC_FLAGS} --graph=${SCL_BINARY_DIR}/expparse.dot" )
endif( BISON_GRAPH )
set( YACC_FLAGS "${EXTRA_YACC_FLAGS} " )
set( LEX_FLAGS " " ) # -d for lexer debugging
ELSE()
set( LEX_FLAGS " " )
set( YACC_FLAGS " " ) #FindYACC.cmake insists on 3, 5, or 7 args
ENDIF()
IF(BORLAND)
add_definitions( -DYYDEBUG=1 )#always define this. equivalent to 'bison -t'
ELSE()
add_definitions( -DYYDEBUG ) #always define this. equivalent to 'bison -t'
ENDIF()
YACC_TARGET(ExpParser expparse.y ${CMAKE_CURRENT_BINARY_DIR}/expparse.c COMPILE_FLAGS ${YACC_FLAGS})
LEX_TARGET(ExpScanner expscan.l ${CMAKE_CURRENT_BINARY_DIR}/expscan.c COMPILE_FLAGS ${LEX_FLAGS})
ADD_LEX_YACC_DEPENDENCY(ExpScanner ExpParser)
set(EXPRESS_SOURCES
${YACC_ExpParser_OUTPUTS}
${LEX_ExpScanner_OUTPUTS}
symbol.c
type.c
variable.c
expr.c
entity.c
caseitem.c
stmt.c
alg.c
scope.c
schema.c
resolve.c
lexact.c
linklist.c
error.c
dict.c
hash.c
memory.c
object.c
inithook.c
express.c
)
SET(CHECK_EXPRESS_SOURCES
fedex.c
)
IF(MSVC OR BORLAND)
set(CHECK_EXPRESS_EXTRA_SOURCES
xgetopt.cc
inithook.c
)
ENDIF()
SET(EXPRESS_PRIVATE_HDRS
conf.h
exptoks.h
stack.h
)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${SCL_SOURCE_DIR}/src/base
)
add_definitions( -DFLEX )
if(MSVC OR BORLAND)
add_definitions( -DYY_NO_UNISTD_H )
endif()
if(BORLAND)
add_definitions( -D__STDC__ )
add_definitions( -DSCL_BASE_DLL_IMPORTS )
endif()
SCL_ADDLIB(express "${EXPRESS_SOURCES}" "base")
if(APPLE)
if(SCL_BUILD_SHARED_LIBS)
set_target_properties(express PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
endif(SCL_BUILD_SHARED_LIBS)
endif(APPLE)
SCL_ADDEXEC("check-express" "${CHECK_EXPRESS_SOURCES} ${CHECK_EXPRESS_EXTRA_SOURCES}" express)
if(MSVC OR BORLAND)
set_target_properties(express PROPERTIES COMPILE_DEFINITIONS SCL_EXPRESS_DLL_EXPORTS)
set_target_properties("check-express" PROPERTIES COMPILE_DEFINITIONS SCL_EXPRESS_DLL_IMPORTS)
endif()