Fix cmake not triggering rebuild on .glsl changes
authorDalai Felinto <dfelinto@gmail.com>
Tue, 16 Oct 2018 19:54:59 +0000 (16:54 -0300)
committerDalai Felinto <dfelinto@gmail.com>
Tue, 16 Oct 2018 19:58:12 +0000 (16:58 -0300)
At least on windows we do not re-run datatoc when the .glsl files change.

To test is simple, just change edit_mesh_overlay_common_lib.glsl
remove lines, write plain text, ..., now rebuild and go in edit mode
with the default cube.

I also had to remove the entry in gpu/CMakeLists.txt for
gpu_shader_material.glsl since this was being tracked directly, as well
as running data_to_c_simple (otherwise CMake raises an error for
duplicated entries).

We probably want to do the same for the other datatoc functions.

Reviewers: LazyDodo, brecht
Differential Revision: https://developer.blender.org/D3803

build_files/cmake/macros.cmake
source/blender/gpu/CMakeLists.txt

index 762e549955446ec177ee8301d35157c08e706150..3dc6f599c69e2039d426d08c52075b683c16979f 100644 (file)
@@ -1232,6 +1232,8 @@ function(data_to_c_simple
        get_filename_component(_file_to   ${CMAKE_CURRENT_BINARY_DIR}/${file_from}.c REALPATH)
 
        list(APPEND ${list_to_add} ${_file_to})
+       source_group(Generated FILES ${_file_to})
+       list(APPEND ${list_to_add} ${file_from})
        set(${list_to_add} ${${list_to_add}} PARENT_SCOPE)
 
        get_filename_component(_file_to_path ${_file_to} PATH)
index 85a3b604e332ef3e21b79e7c3a6b953f1ff0f6a8..2eb24f08227640f81ee4df87fac89022518adeba 100644 (file)
@@ -87,8 +87,6 @@ set(SRC
        intern/gpu_vertex_format.c
        intern/gpu_viewport.c
 
-       shaders/gpu_shader_material.glsl
-
        GPU_attr_binding.h
        GPU_batch.h
        GPU_batch_presets.h