summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/rendering/src/window.c5
-rw-r--r--tools/cmake/DawAddState.cmake3
4 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a152839..44de303 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,6 +51,10 @@ if(DAW_BUILD_DEBUG AND NOT_SUBPROJECT)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
endif()
+if(DAW_BUILD_HOTRELOAD)
+ set(BUILD_SHARED_LIBS ON)
+endif()
+
if(DAW_BUILD_UBSAN AND DAW_BUILD_ASAN)
message(FATAL_ERROR "You cannot build both asan and ubsan")
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ff4e112..7d1853b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -45,7 +45,6 @@ target_link_libraries(${PROJECT_NAME}
)
target_compile_features(${PROJECT_NAME} PRIVATE c_std_99)
-set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
if(DAW_BUILD_ASAN AND NOT C_COMPILER_ID STREQUAL MSVC)
add_compile_options(-fsanitize=address -fsanitize=leak -fsanitize-address-use-after-scope)
diff --git a/src/rendering/src/window.c b/src/rendering/src/window.c
index 1ddaf47..8c22bbd 100644
--- a/src/rendering/src/window.c
+++ b/src/rendering/src/window.c
@@ -99,11 +99,10 @@ Window init_window_glfw(
glfwSetFramebufferSizeCallback(window, window_size_callback);
// Create the window datastructure
- ret = (Window)calloc(1, sizeof(Window));
+ ret = (Window)calloc(1, sizeof(struct Window));
ret->framework = WINDOW_FRAMEWORK_GLFW;
ret->renderer = WINDOW_RENDERER_NONE;
- ret->windowsize[0] = windowsize[0];
- ret->windowsize[1] = windowsize[1];
+ glm_ivec2_copy(windowsize, ret->windowsize);
ret->window = window;
// Last parameter is used for the renderer
ret->context = NULL;
diff --git a/tools/cmake/DawAddState.cmake b/tools/cmake/DawAddState.cmake
index 0a6c14e..50f0c63 100644
--- a/tools/cmake/DawAddState.cmake
+++ b/tools/cmake/DawAddState.cmake
@@ -47,8 +47,9 @@ macro(daw_add_state STATENAME)
add_library(${STATENAME} SHARED ${STATE_SOURCES})
endif()
- set_property(TARGET ${STATENAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
+ target_link_libraries(${STATENAME} PUBLIC daw)
+ set_property(TARGET ${STATENAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
else()
add_library(${STATENAME} OBJECT ${STATE_SOURCES})