aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-12-24 00:42:30 -0700
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-12-24 00:42:30 -0700
commiteaa5e39d906034b287a054b7587d5e4d08c6c729 (patch)
tree86bc79cb679ea9b2507f2a854454b1ddf3539630
parent569a833ec9d18c5ad82d2334ec2c72ec01a5e460 (diff)
Got it working on windows
-rw-r--r--CMakeLists.txt15
1 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2f665e..e85c450 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.11)
project(KillaFacsista VERSION 1.0)
+find_package(raylib 3.0 REQUIRED)
+
set(C_STANDARD 99)
set(C_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
@@ -11,6 +13,11 @@ if (EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html") # This line is used to set your executable to build with the emscripten html template so taht you can directly open it.
endif ()
+if (WIN32)
+ # Hide the cmd in windows.
+ set(CMAKE_C_FLAGS "-Wl,-subsystem,windows")
+endif (WIN32)
+
# Add source files.
file(GLOB SRC_FILES src/*.c src/entities/*.c src/levels/*.c src/screens/*.c)
@@ -21,10 +28,14 @@ if (${PLATFORM} MATCHES "Web")
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "--preload-file assets.rres")
endif()
-set(RAYLIB raylib)
+set(RAYLIB_LIB raylib)
target_include_directories(${PROJECT_NAME} PUBLIC include src)
-target_link_libraries(${PROJECT_NAME} ${RAYLIB} m glfw)
+target_link_libraries(${PROJECT_NAME} ${RAYLIB_LIB} m)
+
+if (WIN32)
+ target_link_libraries(${PROJECT_NAME} opengl32 gdi32 winmm)
+endif (WIN32)
file(COPY assets/assets.rres DESTINATION ${CMAKE_BINARY_DIR})