From: Tim Goya Date: Mon, 5 Nov 2007 15:21:06 +0000 (+0000) Subject: fix wrapper generation and miniswig build X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ef0b43133a0bb6cce3c37c76f3db1250e3612cb3;p=supertux.git fix wrapper generation and miniswig build SVN-Revision: 5180 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3008a4ff2..354e973bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,14 +58,6 @@ MARK_AS_ADVANCED( LIBRARY_OUTPUT_PATH ) - -## Some default settings - -OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" FALSE) -OPTION(ENABLE_OPENGL "Enable OpenGL support" TRUE) -OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG}) - - ## For autopackage MARK_AS_ADVANCED( ENABLE_BINRELOC @@ -98,6 +90,7 @@ MARK_AS_ADVANCED( INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR}) LINK_LIBRARIES(${SDLIMAGE_LIBRARY}) +OPTION(ENABLE_OPENGL "Enable OpenGL support" TRUE) IF(ENABLE_OPENGL) FIND_PACKAGE(OpenGL) IF(${OPENGL_FOUND} STREQUAL "YES") @@ -171,8 +164,28 @@ include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/include/) FILE(GLOB SUPERTUX_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/*.cpp src/audio/*.cpp src/badguy/*.cpp src/binreloc/*.cpp src/control/*.cpp src/gui/*.cpp src/lisp/*.cpp src/math/*.cpp src/object/*.cpp src/physfs/*.cpp src/sprite/*.cpp src/tinygettext/*.cpp src/trigger/*.cpp src/video/*.cpp src/worldmap/*.cpp src/scripting/*.cpp) +## Debug options + +OPTION(DEBUG "Build with debugging options" FALSE) +OPTION(PROFILE "Build with profiling information" FALSE) +IF(CMAKE_COMPILER_IS_GNUCC) + IF (DEBUG) + REMOVE_DEFINITIONS(-O2) + ADD_DEFINITIONS(-O0 -g -Wall -Werror) + ELSE (DEBUG) + ADD_DEFINITIONS(-O2) + REMOVE_DEFINITIONS(-O0 -g -Wall -Werror) + ENDIF (DEBUG) + IF (PROFILE) + ADD_DEFINITIONS(-pg) + ELSE (PROFILE) + REMOVE_DEFINITIONS(-pg) + ENDIF (PROFILE) +ENDIF(CMAKE_COMPILER_IS_GNUCC) + ## Add in squirrel debug stuff +OPTION(ENABLE_SQDBG "Build squirrel script interpreter with debugging options" FALSE) IF(ENABLE_SQDBG) include_directories (${SUPERTUX_SOURCE_DIR}/src/squirrel/) FILE(GLOB SQDBG_SOURCES RELATIVE ${SUPERTUX_SOURCE_DIR} src/squirrel/sqdbg/*.cpp) @@ -181,6 +194,7 @@ ENDIF(ENABLE_SQDBG) ## Build miniswig and generate miniswig wrapper +OPTION(GENERATE_WRAPPER "Build miniswig and generate the wrapper" ${DEBUG}) IF(GENERATE_WRAPPER) ADD_SUBDIRECTORY(tools/miniswig) ADD_CUSTOM_COMMAND( @@ -194,7 +208,7 @@ IF(GENERATE_WRAPPER) ENDIF(GENERATE_WRAPPER) IF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) - SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES}) + SET(SUPERTUX_SOURCES ${SUPERTUX_SOURCES} ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) ## If xgettext is available, generate messages.pot for sources @@ -217,27 +231,6 @@ ENDIF(NOT EXISTS ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp) # ) #ENDIF(${XGETTEXT} STREQUAL "XGETTEXT-NOTFOUND") - -## Debug options - -OPTION(DEBUG "Build with debugging options" FALSE) -OPTION(PROFILE "Build with profiling information" FALSE) -IF(CMAKE_COMPILER_IS_GNUCC) - IF (DEBUG) - REMOVE_DEFINITIONS(-O2) - ADD_DEFINITIONS(-O0 -g -Wall -Werror) - ELSE (DEBUG) - ADD_DEFINITIONS(-O2) - REMOVE_DEFINITIONS(-O0 -g -Wall -Werror) - ENDIF (DEBUG) - IF (PROFILE) - ADD_DEFINITIONS(-pg) - ELSE (PROFILE) - REMOVE_DEFINITIONS(-pg) - ENDIF (PROFILE) -ENDIF(CMAKE_COMPILER_IS_GNUCC) - - ## Some additional compiler switches IF(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS(-fno-strict-aliasing) diff --git a/tools/miniswig/CMakeLists.txt b/tools/miniswig/CMakeLists.txt index 040e8425a..6f1cbe7d3 100644 --- a/tools/miniswig/CMakeLists.txt +++ b/tools/miniswig/CMakeLists.txt @@ -24,6 +24,15 @@ PROJECT(MINISWIG) ## add additional compiler switches ADD_DEFINITIONS(-include ${CMAKE_BINARY_DIR}/config.h) +REMOVE_DEFINITIONS(-Wall) + +## Include paths to make generated files work + +INCLUDE_DIRECTORIES (${MINISWIG_SOURCE_DIR}) + +## build list of source files + +FILE(GLOB MINISWIG_SOURCES RELATIVE ${MINISWIG_SOURCE_DIR} create_docu.cpp create_wrapper.cpp main.cpp tree.cpp xmlwriter.cpp) ## Add target for bison parser generation @@ -51,14 +60,6 @@ ADD_CUSTOM_COMMAND( DEPENDS lexer.ll ${MINISWIG_BINARY_DIR}/parser.hpp ) -## Include paths to make generated files work - -INCLUDE_DIRECTORIES (${MINISWIG_SOURCE_DIR}) - -## build list of source files - -FILE(GLOB MINISWIG_SOURCES RELATIVE ${MINISWIG_SOURCE_DIR} create_docu.cpp create_wrapper.cpp main.cpp tree.cpp xmlwriter.cpp) - ## Add target for miniswig binary ADD_EXECUTABLE(miniswig ${MINISWIG_SOURCES} ${MINISWIG_BINARY_DIR}/parser.cpp ${MINISWIG_BINARY_DIR}/lexer.cpp)