File tree 3 files changed +20
-3
lines changed
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -45,3 +45,9 @@ CMakeFiles
45
45
# Ignore compile database
46
46
# ==============================================================================#
47
47
compile_commands.json
48
+
49
+ # Ignore generated GYB files until we fix the workaround on Windows
50
+ # ==============================================================================#
51
+ 8
52
+ 4
53
+ SortedCFDatabase.def
Original file line number Diff line number Diff line change @@ -123,6 +123,7 @@ function(add_custom_command_target dependency_out_var_name)
123
123
# CMake doesn't allow '/' characters in filenames, so replace them with '-'
124
124
list (GET ACCT_OUTPUT 0 output_filename)
125
125
string (REPLACE "${CMAKE_BINARY_DIR} /" "" target_name "${output_filename} " )
126
+ string (REPLACE "${CMAKE_SOURCE_DIR} /" "" target_name "${target_name} " )
126
127
string (REPLACE "${CMAKE_CFG_INTDIR} /" "" target_name "${target_name} " )
127
128
string (REPLACE "/" "-" target_name "${target_name} " )
128
129
else ()
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ function(handle_gyb_source_single dependency_out_var_name)
51
51
COMMAND
52
52
"${CMAKE_COMMAND} " -E make_directory "${dir} "
53
53
COMMAND
54
- "${gyb_tool} " "${gyb_flags} "
54
+ "${PYTHON_EXECUTABLE} " " ${ gyb_tool} " "${gyb_flags} "
55
55
-o "${GYB_SINGLE_OUTPUT} .tmp" "${GYB_SINGLE_SOURCE} "
56
56
COMMAND
57
57
"${CMAKE_COMMAND} " -E copy_if_different
@@ -113,10 +113,20 @@ function(handle_gyb_sources dependency_out_var_name sources_var_name arch)
113
113
if (src STREQUAL src_sans_gyb)
114
114
list (APPEND de_gybbed_sources "${src} " )
115
115
else ()
116
+
117
+ # On Windows (using Visual Studio), the generated project files assume that the
118
+ # generated GYB files will be in the source, not binary directory.
119
+ # We can work around this by modifying the root directory when generating VS projects.
120
+ if ("${CMAKE_GENERATOR_PLATFORM} " MATCHES "Visual Studio" )
121
+ set (dir_root ${CMAKE_CURRENT_SOURCE_DIR} )
122
+ else ()
123
+ set (dir_root ${CMAKE_CURRENT_BINARY_DIR} )
124
+ endif ()
125
+
116
126
if (arch)
117
- set (dir "${CMAKE_CURRENT_BINARY_DIR } /${ptr_size} " )
127
+ set (dir "${dir_root } /${ptr_size} " )
118
128
else ()
119
- set (dir "${CMAKE_CURRENT_BINARY_DIR } " )
129
+ set (dir "${dir_root } " )
120
130
endif ()
121
131
set (output_file_name "${dir} /${src_sans_gyb} " )
122
132
list (APPEND de_gybbed_sources "${output_file_name} " )
You can’t perform that action at this time.
0 commit comments