cmake_minimum_required(VERSION 2.8.5)
project(z80e C)
option(enable-sdl "Enables the SDL frontend" NO)
option(enable-tui "Enables the TUI frontend" YES)
option(enable-zex "Enables the zex test suite" NO)
option(enable-test "Enables the unit test frontend" NO)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")

add_subdirectory(libz80e libz80e)
add_subdirectory(frontends/libz80e frontends/libz80e)
if(enable-test)
add_subdirectory(frontends/test frontends/test)
endif()

if(NOT DEFINED EMSCRIPTEN)
  if(enable-tui)
    add_subdirectory(frontends/tui frontends/tui)
  endif()
  if(enable-sdl)
    add_subdirectory(frontends/sdl frontends/sdl)
  endif()
  if(enable-zex)
    add_subdirectory(frontends/zex frontends/zex)
  endif()
endif()

set(CMAKE_BUILD_TYPE Release)

cmake_minimum_required(VERSION 2.8.5)
project(z80e C)
option(enable-sdl "Enables the SDL frontend" NO)
option(enable-tui "Enables the TUI frontend" YES)
option(enable-zex "Enables the zex test suite" NO)
option(enable-test "Enables the unit test frontend" NO)

if(NOT WIN32 OR CYGWIN)
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()

add_subdirectory(libz80e libz80e)
add_subdirectory(frontends/libz80e frontends/libz80e)
if(enable-test)
add_subdirectory(frontends/test frontends/test)
endif()

if(NOT DEFINED EMSCRIPTEN)
  if(enable-tui)
    add_subdirectory(frontends/tui frontends/tui)
  endif()
  if(enable-sdl)
    add_subdirectory(frontends/sdl frontends/sdl)
  endif()
  if(enable-zex)
    add_subdirectory(frontends/zex frontends/zex)
  endif()
endif()

set(CMAKE_BUILD_TYPE Release)

Fix PIC warning on cygwin/windows
Fix PIC warning on cygwin/windows
