tools/pas2c/CMakeLists.txt
author unc0rr
Sat, 27 Dec 2014 22:09:31 +0300
branch0.9.21
changeset 10721 9b789de8e5df
parent 9238 84e591af6c29
child 13863 4f123ac4f002
permissions -rw-r--r--
Workaround bug (each time losing room master status, even when joining mutliple rooms, new instance of NetAmmoSchemeModel created, receiving schemeConfig and modifying its 43rd member, thus the last model which accepts this signal has the string cut down several times, workaround creates copy of qstringlist to avoid modifying shared message instance. Proper fix would delete unneeded instances of NetAmmoSchemeModel, but who cares)

find_package(GHC REQUIRED)

set(pas2c_sources
        Main.hs
        PascalBasics.hs
        PascalParser.hs
        PascalPreprocessor.hs
        PascalUnitSyntaxTree.hs
        Pas2C.hs
    )

set(pas2c_main ${CMAKE_SOURCE_DIR}/tools/pas2c/Main.hs)

set(ghc_flags
        --make ${pas2c_main}
        -i${CMAKE_SOURCE_DIR}/tools/pas2c/
        -o ${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}
        -odir ${CMAKE_CURRENT_BINARY_DIR}
        -hidir ${CMAKE_CURRENT_BINARY_DIR}
        ${haskell_flags}
    )

add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}"
        COMMAND "${GHC_EXECUTABLE}"
        ARGS ${ghc_flags}
        MAIN_DEPENDENCY ${hwserv_main}
        DEPENDS ${hwserver_sources}
        )

add_custom_target(pas2c ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/pas2c${CMAKE_EXECUTABLE_SUFFIX}")