From 478350959212cc1e74ed5860fc31aafab61283b8 Mon Sep 17 00:00:00 2001 From: jimtahu Date: Fri, 26 Jul 2013 23:34:50 -0500 Subject: [PATCH] Switched from using cmake to waf --- CMakeLists.txt | 29 ----------------------------- wscript | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 29 deletions(-) delete mode 100644 CMakeLists.txt create mode 100644 wscript diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index c570296..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -project(LangS) - -find_package(BISON) -find_package(FLEX) - -find_program(bison "bison") -find_program(flex "flex") - -file(GLOB sources *.cpp) - -add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/LangS.tab.cpp - DEPENDS LangS.ypp - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND @bison@ -d ${CMAKE_CURRENT_SOURCE_DIR}/LangS.ypp VERBATIM) - -add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/LangS.yy.cpp - DEPENDS LangS.l - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND @flex@ -o ${CMAKE_CURRENT_SOURCE_DIR}/LangS.yy.cpp ${CMAKE_CURRENT_SOURCE_DIR}/LangS.l VERBATIM) - -set_source_files_properties(LangS.tab.cpp PROPERTIES GENERATED True) -set_source_files_properties(LangS.tab.hpp PROPERTIES GENERATED True) -set_source_files_properties(LangS.yy.cpp PROPERTIES GENERATED True) - - -add_executable(LangS LangS.tab.cpp LangS.yy.cpp @sources@) - diff --git a/wscript b/wscript new file mode 100644 index 0000000..16b676d --- /dev/null +++ b/wscript @@ -0,0 +1,15 @@ +def options(ctx): + ctx.load('compiler_cxx') + +def configure(ctx): + ctx.load('compiler_cxx') + ctx.find_program('flex', var='FLEX') + ctx.find_program('bison', var='BISON') + +def build(bld): + sources = bld.path.ant_glob('*.cpp') + ['LangS.tab.cpp', 'LangS.yy.cpp' ] + bld(rule = '${FLEX} -o ${TGT} ${SRC}', source= 'LangS.l', target = 'LangS.yy.cpp') + bld(rule = '${BISON} -d ${SRC}', source= 'LangS.ypp', target = ['LangS.tab.cpp','LangS.tab.hpp']) + langs = bld(features='c cxx cxxprogram', source=sources, target='LangS', includes='.') + +