aboutsummaryrefslogtreecommitdiff
path: root/api_test/CMakeLists.txt
blob: e3e84f6ce83cc65fed483d82a49ae6df129b979b (plain)
  1. add_executable(api_test
  2.   cplusplus.cpp
  3. harness.c
  4. harness.h
  5. main.c
  6. )
  7. include_directories(
  8. ${PROJECT_SOURCE_DIR}/src
  9. ${PROJECT_BINARY_DIR}/src
  10. )
  11. target_link_libraries(api_test libcmark)
  12. # Compiler flags
  13. if(MSVC)
  14. # Force to always compile with W4
  15. if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
  16. string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
  17. else()
  18. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
  19. endif()
  20. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4244 /wd4267 /wd4706 /wd4800 /D_CRT_SECURE_NO_WARNINGS")
  21. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /TP")
  22. elseif(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
  23. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -std=c99 -pedantic")
  24. endif()