#build file for CMake, see http://www.cmake.org/
PROJECT (small)

ADD_DEFINITIONS(-DFLOATPOINT -DFIXEDPOINT)
IF (UNIX)
  ADD_DEFINITIONS(-DLINUX -g)
  INCLUDE_DIRECTORIES(linux)
  LINK_LIBRARIES(m dl) #CMake adds the "lib" prefix, so "m" becomes "libm"
ENDIF (UNIX)

# Simple run-time (example program)
SET(SRUN_SRCS amx/srun.c amx/amx.c amx/amxcore.c amx/amxcons.c)
IF (UNIX)
  SET(SRUN_SRCS ${SRUN_SRCS} linux/getch.c)
ENDIF (UNIX)
ADD_EXECUTABLE(srun ${SRUN_SRCS})

# Simple console debugger
SET(SDBG_SRCS amx/sdbg.c amx/amx.c amx/amxcore.c amx/amxcons.c)
IF (UNIX)
  SET(SDBG_SRCS ${SDBG_SRCS} linux/getch.c)
ENDIF (UNIX)
ADD_EXECUTABLE(sdbg ${SDBG_SRCS})

# The Small compiler
SET(SC_SRCS compiler/sc1.c compiler/sc2.c compiler/sc3.c compiler/sc4.c
	compiler/sc5.c compiler/sc6.c compiler/sc7.c compiler/scexpand.c
	compiler/sclist.c compiler/scvars.c compiler/sci18n.c compiler/scmemfil.c)
INCLUDE_DIRECTORIES(amx)
ADD_EXECUTABLE(sc ${SC_SRCS})
