Skip to content

Commit

Permalink
Switch build system to CMake
Browse files Browse the repository at this point in the history
This unifies the build system across platforms, including doing
development inside Visual Studio. No change to other code.
  • Loading branch information
LaserEyess committed Jul 5, 2023
1 parent b78af7e commit 794dded
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 794dded

Please sign in to comment.