Skip to content

Commit 794dded

Browse files
committed
Switch build system to CMake
This unifies the build system across platforms, including doing development inside Visual Studio. No change to other code.
1 parent b78af7e commit 794dded

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ target_include_directories(gl PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
4343
# ---------------
4444
add_executable(sm)
4545
add_subdirectory(src)
46+
<<<<<<< HEAD
4647

4748
# Math library
4849
find_library(MATHLIB m)
@@ -63,6 +64,23 @@ target_compile_definitions(sm PRIVATE
6364

6465
# Nintendo Switch extra setup
6566
if (NINTENDO_SWITCH)
67+
=======
68+
target_link_libraries(sm PRIVATE SDL2::SDL2 gl)
69+
set_target_properties(sm PROPERTIES C_STANDARD 11)
70+
71+
if (MSVC)
72+
target_compile_options(sm PRIVATE ${msvc_warnings})
73+
else()
74+
target_link_libraries(sm PRIVATE m)
75+
target_compile_definitions(sm PRIVATE SYSTEM_VOLUME_MIXER_AVAILABLE=0)
76+
target_compile_options(sm PRIVATE ${c_warnings})
77+
endif()
78+
79+
# Nintendo Switch extra setup
80+
if (NINTENDO_SWITCH)
81+
target_compile_definitions(sm PUBLIC __SWITCH__)
82+
83+
>>>>>>> 6d96c49 (Switch build system to CMake)
6684
# needs to be linked with g++ for C++ stdlib
6785
enable_language(CXX)
6886
set_target_properties(sm PROPERTIES

0 commit comments

Comments
 (0)