Add build rules for system1 and system2

This commit is contained in:
kichikuou
2019-08-18 15:12:41 +09:00
parent 1b192c2b9f
commit b10d6447fe
3 changed files with 51 additions and 35 deletions
+49 -29
View File
@@ -1,19 +1,13 @@
cmake_minimum_required(VERSION 3.13)
project(system3 LANGUAGES CXX)
project(System3 LANGUAGES CXX)
add_executable(system3)
target_compile_definitions(system3 PRIVATE _SYSTEM3 $<$<CONFIG:Debug>:_DEBUG_CONSOLE>)
target_include_directories(system3 PRIVATE . sys)
target_sources(system3 PRIVATE
set(SRC_COMMON
sdlmain.cpp
fileio.cpp
sys/ags.cpp
sys/ags_bmp.cpp
sys/ags_cursor.cpp
sys/ags_draw.cpp
sys/ags_pms.cpp
sys/ags_text.cpp
sys/ags_vsp.cpp
sys/ags_window.cpp
@@ -21,34 +15,74 @@ target_sources(system3 PRIVATE
sys/nact.cpp
sys/nact_crc32.cpp
sys/nact_input.cpp
sys/nact_sys3.cpp
)
if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
target_sources(system3 PRIVATE
set(SRC_PLATFORM
linux/nact_linux.cpp
emscripten/mako.cpp
)
else()
target_sources(system3 PRIVATE
set(SRC_MAKO
sys/mako.cpp
sys/mako_midi.cpp
)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_sources(system3 PRIVATE
set(SRC_PLATFORM
win/nact_win.cpp
win/mako_win.cpp
res3/Script1.rc
)
set(RES1 res1/Script1.rc)
set(RES3 res3/Script1.rc)
else()
target_sources(system3 PRIVATE
set(SRC_PLATFORM
linux/nact_linux.cpp
linux/mako_linux.cpp
)
endif()
endif()
if (EMSCRIPTEN)
add_library(common INTERFACE)
target_compile_definitions(common INTERFACE $<$<CONFIG:Debug>:_DEBUG_CONSOLE>)
target_include_directories(common INTERFACE . sys)
target_sources(common INTERFACE ${SRC_COMMON} ${SRC_PLATFORM} ${SRC_MAKO})
add_executable(system3)
target_sources(system3 PRIVATE sys/nact_sys3.cpp ${RES3} sys/ags_bmp.cpp sys/ags_pms.cpp)
target_compile_definitions(system3 PRIVATE _SYSTEM3)
target_link_libraries(system3 PRIVATE common)
if (NOT EMSCRIPTEN)
add_executable(system1)
target_sources(system1 PRIVATE sys/nact_sys1.cpp ${RES1} sys/ags_gl3.cpp sys/ags_gm3.cpp sys/ags_vsp2l.cpp)
target_compile_definitions(system1 PRIVATE _SYSTEM1)
target_link_libraries(system1 PRIVATE common)
add_executable(system2)
target_sources(system2 PRIVATE sys/nact_sys2.cpp ${RES1} sys/ags_gl3.cpp sys/ags_pms.cpp)
target_compile_definitions(system2 PRIVATE _SYSTEM2 _SDPS)
target_link_libraries(system2 PRIVATE common)
add_executable(prog_omake)
target_sources(prog_omake PRIVATE sys/nact_sys3.cpp ${RES3} sys/ags_pms.cpp)
target_compile_definitions(prog_omake PRIVATE _PROG_OMAKE)
target_link_libraries(prog_omake PRIVATE common)
include(FindPkgConfig)
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
pkg_check_modules(SDL2TTF REQUIRED IMPORTED_TARGET SDL2_ttf)
target_link_libraries(common INTERFACE PkgConfig::SDL2 PkgConfig::SDL2TTF)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(common INTERFACE winmm)
endif()
install(TARGETS system1 system2 system3 prog_omake RUNTIME DESTINATION bin)
else() # emscripten
set(LIBS "SHELL:-s USE_SDL=2" "SHELL:-s USE_SDL_TTF=2")
target_compile_options(system3 PRIVATE ${LIBS})
@@ -65,18 +99,4 @@ if (EMSCRIPTEN)
"SHELL:-s EXPORTED_FUNCTIONS=\"['_main','_ags_setAntialiasedStringMode']\""
"SHELL:-s EXTRA_EXPORTED_RUNTIME_METHODS=\"['getValue','getMemory','addRunDependency','removeRunDependency']\"")
else()
include(FindPkgConfig)
pkg_check_modules(SDL2 REQUIRED IMPORTED_TARGET sdl2)
pkg_check_modules(SDL2TTF REQUIRED IMPORTED_TARGET SDL2_ttf)
target_link_libraries(system3 PRIVATE PkgConfig::SDL2 PkgConfig::SDL2TTF)
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_link_libraries(system3 PRIVATE winmm)
endif()
install(TARGETS system3 RUNTIME DESTINATION bin)
endif()
-2
View File
@@ -67,8 +67,6 @@
} \
}
extern HWND g_hwnd;
void NACT::opening()
{
#if defined(_CRESCENT)
+2 -4
View File
@@ -55,8 +55,6 @@
} \
}
extern HWND g_hwnd;
void NACT::cmd_calc()
{
int index = getd();
@@ -1471,7 +1469,7 @@ void NACT::cmd_y()
Uint32 dwStart = SDL_GetTicks();
for(int i = 0; i < 16; i++) {
ags->fade_in(i);
DWORD dwTime = dwStart + param * 1000 / 60 * i;
Uint32 dwTime = dwStart + param * 1000 / 60 * i;
for(;;) {
if(terminate) {
return;
@@ -1490,7 +1488,7 @@ void NACT::cmd_y()
Uint32 dwStart = SDL_GetTicks();
for(int i = 0; i < 16; i++) {
ags->fade_out(i, (cmd == 41) ? false : true);
DWORD dwTime = dwStart + param * 1000 / 60 * i;
Uint32 dwTime = dwStart + param * 1000 / 60 * i;
for(;;) {
if(terminate) {
return;