project_files/hwc/CMakeLists.txt
changeset 11659 71bdf987e41f
parent 11654 870f22de388b
child 11661 7d483d400f8d
equal deleted inserted replaced
11658:f87ed83568c8 11659:71bdf987e41f
     4 find_package(SDL2 REQUIRED)
     4 find_package(SDL2 REQUIRED)
     5 find_package(SDL2_mixer REQUIRED)
     5 find_package(SDL2_mixer REQUIRED)
     6 find_package(SDL2_net REQUIRED)
     6 find_package(SDL2_net REQUIRED)
     7 find_package(SDL2_image REQUIRED)
     7 find_package(SDL2_image REQUIRED)
     8 find_package(SDL2_ttf REQUIRED)
     8 find_package(SDL2_ttf REQUIRED)
     9 if(BUILD_ENGINE_JS)
       
    10     find_package(Emscripten REQUIRED)
       
    11 endif()
       
    12 
     9 
    13 #compile our rtl implementation
    10 #compile our rtl implementation
    14 include_directories(${GLEW_INCLUDE_DIR})
    11 include_directories(${GLEW_INCLUDE_DIR})
    15 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rtl)
    12 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/rtl)
    16 include_directories(${PHYSFS_INCLUDE_DIR})
    13 include_directories(${PHYSFS_INCLUDE_DIR})
    79 
    76 
    80 #compile the c files
    77 #compile the c files
    81 add_definitions(-DPAS2C)
    78 add_definitions(-DPAS2C)
    82 add_definitions(-Werror=incompatible-pointer-types)
    79 add_definitions(-Werror=incompatible-pointer-types)
    83 
    80 
       
    81 add_executable(hwengine WIN32 ${engine_sources})
       
    82 
    84 if(BUILD_ENGINE_JS)
    83 if(BUILD_ENGINE_JS)
    85     #hijack the c compiler with emscripten
    84     set_target_properties(hwengine PROPERTIES SUFFIX ".html")
    86     set(CMAKE_C_COMPILER ${EMSCRIPTEN_EXECUTABLE})
       
    87 endif()
    85 endif()
    88 
       
    89 add_executable(hwengine WIN32 ${engine_sources})
       
    90 
    86 
    91 target_link_libraries(hwengine  fpcrtl
    87 target_link_libraries(hwengine  fpcrtl
    92                                 ${LUA_LIBRARY}
    88                                 ${LUA_LIBRARY}
    93                                 ${OPENGL_LIBRARY}
    89                                 ${OPENGL_LIBRARY}
    94                                 ${SDL2_LIBRARY}
    90                                 ${SDL2_LIBRARY}