project(nothing)
if(WIN32)
- set(SDL2_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/SDL2/include")
+ set(SDL2_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/SDL2/include")
# Support both 32 and 64 bit builds
if (${CMAKE_SIZEOF_VOID_P} MATCHES 8)
find_package(SDL2 REQUIRED)
endif()
+if("${SDL2_LIBRARIES}" STREQUAL "")
+ message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
+ set(SDL2_LIBRARIES "SDL2::SDL2")
+endif()
+
include_directories(${CMAKE_BINARY_DIR})
include_directories(src/)
-include_directories(${SDL2_INCLUDE_DIR})
+include_directories(${SDL2_INCLUDE_DIRS})
add_library(system STATIC
src/system/line_stream.c
target_link_libraries(ebisp system)
add_executable(nothing
- broadcast_lisp.h
src/broadcast.c
src/broadcast.h
src/color.c
src/game/level/level_editor/player_layer.c
src/game/level/level_editor/layer.h
src/game/level/level_editor/layer.c
+ src/game/level/level_editor/label_layer.c
+ src/game/level/level_editor/label_layer.h
+ src/system/file.h
+ src/system/file.c
)
-target_link_libraries(nothing ${SDL2_LIBRARIES} m system ebisp)
-
-add_custom_command(
- OUTPUT broadcast_lisp.h
- COMMAND ${CMAKE_BINARY_DIR}/baker ${CMAKE_SOURCE_DIR}/src/broadcast.lisp broadcast_lisp.h broadcast_lisp_library
- DEPENDS baker src/broadcast.lisp)
+target_link_libraries(nothing ${SDL2_LIBRARIES} system ebisp)
add_executable(repl
src/ebisp/repl.c
src/ebisp/repl_runtime.c
)
-target_link_libraries(repl ${SDL2_LIBRARIES} m system ebisp)
-
-add_executable(baker
- src/ebisp/baker.c
- )
-target_link_libraries(baker m system ebisp)
+target_link_libraries(repl ${SDL2_LIBRARIES} system ebisp)
add_executable(nothing_test
test/main.c
test/test.h
test/tokenizer_suite.h
)
-target_link_libraries(nothing_test ${SDL2_LIBRARIES} m system ebisp)
-
-if (UNIX)
- add_subdirectory(devtools/svg2level)
-endif()
+target_link_libraries(nothing_test ${SDL2_LIBRARIES} system ebisp)
if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
set(CMAKE_C_FLAGS
-ggdb \
-O3")
target_link_libraries(nothing m)
+elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ set(CMAKE_C_FLAGS
+ "${CMAKE_C_FLAGS} \
+ /Wall \
+ /WX \
+ /wd4127 \
+ /wd4201 \
+ /wd4204 \
+ /wd4255 \
+ /wd4389 \
+ /wd4668 \
+ /wd4702 \
+ /wd4710 \
+ /wd4777 \
+ /wd4820 \
+ /wd5045 \
+ /D \"_CRT_SECURE_NO_WARNINGS\"")
endif()
if(WIN32)
target_link_libraries(nothing Imm32 Version winmm)
endif()
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/sounds DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/images DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test-data DESTINATION ${CMAKE_CURRENT_BINARY_DIR})