moved parser into sources (thus dramatically speeding up compilation)
[aqualang.git] / CMakeLists.txt
blob5348a2d7043eedb597de6308307dd5db099b1b1e
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
3 Project(Aqua)
5 # include path for our cmake modules
6 set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/etc/cmake")
7 include(cotire)
9 set(name "aqua")
10 set(exename ${name}-exe)
11 set(libname ${name}-library)
13 set(libsources
14     "src/parser.cpp"
15     "src/ops.cpp"
16     "src/ops.statement.cpp"
17     "src/ops.member.cpp"
18     "src/ops.import.cpp"
19     "src/builtin.string.cpp"
20     "src/builtin.table.cpp"
21     "src/builtin.array.cpp"
22     "src/builtin.number.cpp"
23     "src/utils.cpp"
24     "src/interp.cpp"
25     "src/stdlib.cpp"
26     "src/stdlib.file.cpp"
29 set(binsources
30     "src/main.cpp"
33 # so 'aqua.h' can be found
34 include_directories("include")
36 ## you may want to change these params -- they apply to g++.
37 ## clang++ will (oddly enough) yield llvm bitcode when '-flto' is passed,
38 ## and 'ld' won't be able to use the generated object files.
39 add_definitions(
40     "-std=c++11"
41     "-march=native"
42     "-flto"
43     "-Wall" "-Wextra"
44     #"-s" "-Wl,-s" "-Os"
45     "-g3" "-ggdb"
48 # library first
49 # praise cmake for making things easier!
50 add_library(${libname} SHARED ${libsources})
51 set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${name})
52 if(WIN32)
53     # get rid of the 'lib' prefix on windows
54     set_target_properties(${libname} PROPERTIES CMAKE_SHARED_LIBRARY_PREFIX "")
55     set_target_properties(${libname} PROPERTIES CMAKE_SHARED_MODULE_PREFIX "")
56 endif()
57 target_link_libraries(${libname})
58 cotire(${libname})
60 # exe next
61 add_executable(${exename} ${binsources})
62 SET_TARGET_PROPERTIES(${exename} PROPERTIES OUTPUT_NAME ${name})
63 target_link_libraries(${exename} ${libname})
64 cotire(${exename})