summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-21 10:11:06 +0200
committerAki <please@ignore.pl>2022-04-21 10:11:06 +0200
commit7b8e199b0b6cccdf022bcd072bcdd8ab6c4072b1 (patch)
treea62245dd557cf0f785be8316a7c9588a58c66fbf
parentbae9506ba490ecdf654122ece0efdf45a8a8eca2 (diff)
downloadbullethell2022-7b8e199b0b6cccdf022bcd072bcdd8ab6c4072b1.zip
bullethell2022-7b8e199b0b6cccdf022bcd072bcdd8ab6c4072b1.tar.gz
bullethell2022-7b8e199b0b6cccdf022bcd072bcdd8ab6c4072b1.tar.bz2
Added support for msvc in cmake
-rw-r--r--CMakeLists.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f47ec87..42eccd4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,11 @@ project(bullethell)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS No)
-set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
+if (MSVC)
+ set(CMAKE_CXX_FLAGS "-D_USE_MATH_DEFINES -Wall")
+else()
+ set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
+endif()
set(CMAKE_CXX_RELEASE "-O3")
if(EMSCRIPTEN)
set(CMAKE_PREFIX_PATH "$ENV{HOME}/.emscripten_cache/sysroot;/usr/lib/emscripten/system")
@@ -31,3 +35,7 @@ add_executable(
WaveGenerator.cpp
)
target_link_libraries(${PROJECT_NAME} raylib)
+if(MSVC)
+ target_link_libraries(${PROJECT_NAME} winmm.lib)
+ target_link_options(${PROJECT_NAME} PRIVATE /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup)
+endif()