|
|
1.1 root 1:
2: include_directories(. ../.. ../includes ${SDL_INCLUDE_DIR})
3:
1.1.1.4 ! root 4: # The sources generated by gencpu:
! 5: set(CPUEMU_SRCS cpustbl.c cpuemu_0.c cpuemu_11.c cpuemu_13.c
! 6: cpuemu_20.c cpuemu_21.c cpuemu_22.c cpuemu_23.c cpuemu_24.c
! 7: cpuemu_31.c cpuemu_32.c cpuemu_33.c cpuemu_40.c cpuemu_50.c)
! 8:
1.1 root 9: # Unfortunately we've got to specify the rules for the generated files twice,
10: # once for cross compiling (with calling the host cc directly) and once
11: # for native compiling so that the rules also work for non-Unix environments...
12: if(CMAKE_CROSSCOMPILING)
13:
14: add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/build68k
1.1.1.4 ! root 15: COMMAND cc -I${CMAKE_CURRENT_SOURCE_DIR}
! 16: ${CMAKE_CURRENT_SOURCE_DIR}/build68k.c
! 17: ${CMAKE_CURRENT_SOURCE_DIR}/writelog.c
! 18: -o ${CMAKE_CURRENT_BINARY_DIR}/build68k
1.1 root 19: DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build68k.c)
20:
21: add_custom_command(OUTPUT cpudefs.c
22: COMMAND ./build68k < ${CMAKE_CURRENT_SOURCE_DIR}/table68k >cpudefs.c
23: DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/table68k
24: ${CMAKE_CURRENT_BINARY_DIR}/build68k)
25:
26: add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/gencpu
27: COMMAND cc -I${CMAKE_CURRENT_SOURCE_DIR}
28: cpudefs.c ${CMAKE_CURRENT_SOURCE_DIR}/gencpu.c
29: ${CMAKE_CURRENT_SOURCE_DIR}/readcpu.c
30: -o ${CMAKE_CURRENT_BINARY_DIR}/gencpu
31: DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gencpu.c
32: ${CMAKE_CURRENT_SOURCE_DIR}/readcpu.c cpudefs.c)
33:
1.1.1.4 ! root 34: add_custom_command(OUTPUT ${CPUEMU_SRCS}
1.1 root 35: COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gencpu
36: DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/gencpu)
37:
38: else() # Rules for normal build follow
39:
1.1.1.4 ! root 40: add_executable(build68k build68k.c writelog.c)
1.1 root 41:
42: get_target_property(BUILD68K_EXE build68k LOCATION)
43: add_custom_command(OUTPUT cpudefs.c
44: COMMAND ${BUILD68K_EXE} < ${CMAKE_CURRENT_SOURCE_DIR}/table68k >cpudefs.c
45: DEPENDS table68k build68k)
46:
47: add_executable(gencpu gencpu.c readcpu.c cpudefs.c)
48:
49: get_target_property(GENCPU_EXE gencpu LOCATION)
1.1.1.4 ! root 50: add_custom_command(OUTPUT ${CPUEMU_SRCS}
1.1 root 51: COMMAND ${GENCPU_EXE} DEPENDS gencpu)
52:
53: endif(CMAKE_CROSSCOMPILING)
54:
55:
1.1.1.3 root 56: # Generated cpuemu_xx.c contains a lot of warnings we don't really care about...
57: set(CPUEMU_CFLAGS "-Wno-sign-compare -Wno-shadow -Wno-unused-variable")
58: if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.6)
59: set (CPUEMU_CFLAGS "${CPUEMU_CFLAGS} -Wno-unused-but-set-variable")
60: endif()
61:
1.1 root 62: if(CMAKE_COMPILER_IS_GNUCC)
1.1.1.4 ! root 63: # Silence some warnings for the autogenerated sources
! 64: set_source_files_properties(${CPUEMU_SRCS} cpudefs.c
1.1.1.3 root 65: PROPERTIES COMPILE_FLAGS ${CPUEMU_CFLAGS})
66:
1.1.1.4 ! root 67: # For the other files, hide some harmless warnings, too (since we
! 68: # try to keep the files in sync with WinUAE, it's hard to fix them)
! 69: if (1)
! 70: set(CPUMAIN_CFLAGS "-Wno-unused-variable -Wno-unused-function -Wno-unused-label")
1.1.1.3 root 71: if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.6)
72: set (CPUMAIN_CFLAGS "${CPUMAIN_CFLAGS} -Wno-unused-but-set-variable")
73: endif()
1.1.1.4 ! root 74: # The remaining warnings can be hidden for the release:
! 75: # set next if to "1" instead of "0"
! 76: if (0)
! 77: set(CPUMAIN_CFLAGS "${CPUMAIN_CFLAGS} -Wno-sign-compare -Wno-maybe-uninitialized -Wno-bad-function-cast")
! 78: endif()
! 79: set_source_files_properties(newcpu.c newcpu_common.c cpummu.c fpp.c memory.c
1.1.1.3 root 80: PROPERTIES COMPILE_FLAGS ${CPUMAIN_CFLAGS})
81: endif()
82:
1.1 root 83: endif(CMAKE_COMPILER_IS_GNUCC)
84:
1.1.1.4 ! root 85: add_library(UaeCpu ${CPUEMU_SRCS} cpudefs.c cpummu.c cpummu030.c custom.c
! 86: debug.c events.c hatari-glue.c memory.c newcpu_common.c
! 87: readcpu.c fpp.c newcpu.c writelog.c)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.