CMakeLists.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #-------------------------------------------------------------------------------------------
  2. # Copyright (C) Electronic Arts Inc. All rights reserved.
  3. #-------------------------------------------------------------------------------------------
  4. cmake_minimum_required(VERSION 3.1)
  5. project(EAStdC CXX)
  6. #-------------------------------------------------------------------------------------------
  7. # Options
  8. #-------------------------------------------------------------------------------------------
  9. option(EASTDC_BUILD_TESTS "Enable generation of build files for tests" OFF)
  10. #-------------------------------------------------------------------------------------------
  11. # Compiler Flags
  12. #-------------------------------------------------------------------------------------------
  13. set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/test/packages/EASTL/scripts/CMake")
  14. include(CommonCppFlags)
  15. #-------------------------------------------------------------------------------------------
  16. # Library definition
  17. #-------------------------------------------------------------------------------------------
  18. file(GLOB EASTDC_SOURCES "source/*.cpp")
  19. add_library(EAStdC ${EASTDC_SOURCES})
  20. if(EASTDC_BUILD_TESTS)
  21. add_subdirectory(test)
  22. endif()
  23. #-------------------------------------------------------------------------------------------
  24. # Defines
  25. #-------------------------------------------------------------------------------------------
  26. add_definitions(-D_CRT_SECURE_NO_WARNINGS)
  27. add_definitions(-D_SCL_SECURE_NO_WARNINGS)
  28. add_definitions(-D_CHAR16T)
  29. #-------------------------------------------------------------------------------------------
  30. # Include directories
  31. #-------------------------------------------------------------------------------------------
  32. target_include_directories(EAStdC PUBLIC include)
  33. #-------------------------------------------------------------------------------------------
  34. # Dependencies
  35. #-------------------------------------------------------------------------------------------
  36. target_link_libraries(EAStdC EABase)
  37. target_link_libraries(EAStdC EAAssert)
  38. target_link_libraries(EAStdC EAThread)