From 794dded4ae3b81f3811a0024b92b51ce4591d31c Mon Sep 17 00:00:00 2001 From: LaserEyess Date: Mon, 29 May 2023 16:16:22 -0400 Subject: [PATCH] Switch build system to CMake This unifies the build system across platforms, including doing development inside Visual Studio. No change to other code. --- CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8d6b9a..5572332 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,7 @@ target_include_directories(gl PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") # --------------- add_executable(sm) add_subdirectory(src) +<<<<<<< HEAD # Math library find_library(MATHLIB m) @@ -63,6 +64,23 @@ target_compile_definitions(sm PRIVATE # Nintendo Switch extra setup if (NINTENDO_SWITCH) +======= +target_link_libraries(sm PRIVATE SDL2::SDL2 gl) +set_target_properties(sm PROPERTIES C_STANDARD 11) + +if (MSVC) + target_compile_options(sm PRIVATE ${msvc_warnings}) +else() + target_link_libraries(sm PRIVATE m) + target_compile_definitions(sm PRIVATE SYSTEM_VOLUME_MIXER_AVAILABLE=0) + target_compile_options(sm PRIVATE ${c_warnings}) +endif() + +# Nintendo Switch extra setup +if (NINTENDO_SWITCH) + target_compile_definitions(sm PUBLIC __SWITCH__) + +>>>>>>> 6d96c49 (Switch build system to CMake) # needs to be linked with g++ for C++ stdlib enable_language(CXX) set_target_properties(sm PROPERTIES