diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f282c41 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.1) + +# External cmake modules +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external/cmake ${CMAKE_MODULE_PATH}) + +project("NewOswan") + +include(GetGitRevisionDescription) +git_describe(VERSION --tags --dirty=-dirty) + +find_package(SDL 1.2 REQUIRED) + +set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Wno-write-strings -Werror") +set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Wno-write-strings -Werror") + +message("-- Building version ${VERSION}") + +add_executable(wonderswan main.cpp) + +target_compile_definitions(wonderswan PUBLIC VERSION="${VERSION}") +target_include_directories(wonderswan PUBLIC source) +target_include_directories(wonderswan PUBLIC ${SDL_INCLUDE_DIR}) + +add_subdirectory(source) + +target_link_libraries(wonderswan wswan ${SDL_LIBRARY}) \ No newline at end of file diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt new file mode 100644 index 0000000..466b0a4 --- /dev/null +++ b/source/CMakeLists.txt @@ -0,0 +1,11 @@ +set(SOURCES audio.cpp emulate.cpp gpu.cpp io.cpp log.cpp memory.cpp rom.cpp ws.cpp) +set(HEADERS audio.h emulate.h gpu.h ieeprom.h initialIo.h io.h log.h memory.h rom.h SDLptc.h ws.h) + +add_library(wswan ${SOURCES} ${HEADERS}) + +target_link_libraries(wswan nec_v30) + +target_include_directories(wswan PUBLIC .) +target_include_directories(wswan PUBLIC ${SDL_INCLUDE_DIR}) + +add_subdirectory(nec) \ No newline at end of file diff --git a/source/nec/CMakeLists.txt b/source/nec/CMakeLists.txt new file mode 100644 index 0000000..4ff600e --- /dev/null +++ b/source/nec/CMakeLists.txt @@ -0,0 +1,4 @@ +set(SOURCES nec.cpp) +set(HEADERS nec.h necea.h necinstr.h necintrf.h necmodrm.h) + +add_library(nec_v30 ${SOURCES} ${HEADERS}) \ No newline at end of file