CMakeLists.txt
changeset 8707 404c18aed69f
parent 8706 9f5df5dc44a0
child 8734 ecb0a97100cf
equal deleted inserted replaced
8706:9f5df5dc44a0 8707:404c18aed69f
   246         separate_arguments(fpflags_parsed UNIX_COMMAND ${FPFLAGS})
   246         separate_arguments(fpflags_parsed UNIX_COMMAND ${FPFLAGS})
   247         separate_arguments(ghflags_parsed UNIX_COMMAND ${GHFLAGS})
   247         separate_arguments(ghflags_parsed UNIX_COMMAND ${GHFLAGS})
   248     endif()
   248     endif()
   249 endif()
   249 endif()
   250 
   250 
   251 list(APPEND pascal_flags ${fpflags_parsed}        # user flags
   251 list(APPEND pascal_flags ${fpflags_parsed}            # user flags
   252                  "-vm4079,4080,4081"              # fpc output format
   252                  "-B"                                 # compile all units
   253                  "-B"                             # compile all units
   253                  "-vm4079,4080,4081"                  # fpc verbosity output format
   254                  "-FE${PROJECT_BINARY_DIR}/bin"   # fpc output directory
   254                  "-FE${PROJECT_BINARY_DIR}/bin"       # fpc binaries output directory
   255                  "-FU${PROJECT_BINARY_DIR}/hedgewars" # fpc units output directory
   255                  "-FU${PROJECT_BINARY_DIR}/hedgewars" # fpc units output directory
   256                  "-Fl${PROJECT_BINARY_DIR}/bin"   # fpc linking directory (win/unix)
   256                  "-Fl${PROJECT_BINARY_DIR}/bin"       # fpc linking directory (win/unix)
   257                  "-Fi${PROJECT_BINARY_DIR}/hedgewars" # fpc .inc path (out of source builds)
   257                  "-Fi${PROJECT_BINARY_DIR}/hedgewars" # fpc .inc path (for out of source builds)
   258                  "-k-L${PROJECT_BINARY_DIR}/bin"  # ld linking directory (unix/osx)
   258                  "-k-L${PROJECT_BINARY_DIR}/bin"      # ld linking directory (unix/osx)
   259                  "-Cs2000000"                     # stack size
   259                  "-Cs2000000"                         # stack size
   260                  "-vewnq"                         # fpc output verbosity
   260                  "-vewnq"                             # fpc output verbosity
   261                  "-dDEBUGFILE"                    # macro for engine output
   261                  "-dDEBUGFILE"                        # macro for engine output
   262                  )
   262                  )
   263 list(APPEND haskell_flags ${ghflags_parsed}       # user flags
   263 list(APPEND haskell_flags ${ghflags_parsed} # user flags
   264                  "-O2"                            # optimise for faster code
   264                  "-O2"                      # optimise for faster code
   265                  )
   265                  )
   266 
   266 
   267 
   267 
   268 #get BUILD_TYPE and enable/disable optimisation
   268 #get BUILD_TYPE and enable/disable optimisation
   269 message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
   269 message(STATUS "Using ${CMAKE_BUILD_TYPE} configuration")
   270 if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
   270 if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
   271     list(APPEND pascal_flags "-O-"                # disable all optimisations
   271     list(APPEND pascal_flags "-O-" # disable all optimisations
   272                              "-g"                 # enable debug symbols
   272                              "-g"  # enable debug symbols
   273                              "-gl"                # add line info to bt
   273                              "-gl" # add line info to bt
   274                              "-gv"                # allow valgrind
   274                              "-gv" # allow valgrind
   275                              )
   275                              )
   276     list(APPEND haskell_flags "-Wall"             # all warnings
   276     list(APPEND haskell_flags "-Wall"       # all warnings
   277                               "-debug"            # debug mode
   277                               "-debug"      # debug mode
   278                               "-dcore-lint"       # internal sanity check
   278                               "-dcore-lint" # internal sanity check
   279                               )
   279                               )
   280 else()
   280 else()
   281     list(APPEND pascal_flags "-Os"                # optimise for size
   281     list(APPEND pascal_flags "-Os" # optimise for size
   282                              "-Xs"                # strip binary
   282                              "-Xs" # strip binary
   283                              "-Si"                # turn on inlining
   283                              "-Si" # turn on inlining
   284                              )
   284                              )
   285     list(APPEND haskell_flags "-w"                # no warnings
   285     list(APPEND haskell_flags "-w" # no warnings
   286                               )
   286                               )
   287 endif()
   287 endif()
   288 
   288 
   289 include(${CMAKE_MODULE_PATH}/utils.cmake)
   289 include(${CMAKE_MODULE_PATH}/utils.cmake)
   290 
   290