From cb7af3f4cac90f95926477b4001f9f80037568d5 Mon Sep 17 00:00:00 2001 From: Jun Zhang Date: Sun, 30 Jan 2022 12:30:02 +0800 Subject: refactor: adjust the project infra. (#1) * refactor: adjust the project infra. This patch adds cmake build system to the project, and adjust infrastructure stuff. Signed-off-by: Jun Zhang * fix: remove compiler flags that only exist in GCC. Signed-off-by: Jun Zhang --- third-party/sdl2/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 third-party/sdl2/CMakeLists.txt (limited to 'third-party/sdl2/CMakeLists.txt') diff --git a/third-party/sdl2/CMakeLists.txt b/third-party/sdl2/CMakeLists.txt new file mode 100644 index 0000000..93022fd --- /dev/null +++ b/third-party/sdl2/CMakeLists.txt @@ -0,0 +1,18 @@ +configure_file(CMakeLists.txt.in sdl2/CMakeLists.txt) +execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . + RESULT_VARIABLE result + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sdl2 ) +if(result) + message(FATAL_ERROR "CMake step for sdl2 failed: ${result}") +endif() + +execute_process(COMMAND ${CMAKE_COMMAND} --build . + RESULT_VARIABLE result + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/sdl2 ) +if(result) + message(FATAL_ERROR "Build step for sdl2 failed: ${result}") +endif() + +add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/sdl2-src + ${CMAKE_CURRENT_BINARY_DIR}/sdl2-build) + -- cgit v1.2.3