Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
ce080a0f
Commit
ce080a0f
authored
Jan 02, 2016
by
Matthias Braun
Browse files
CMakeLists: Ensure directories of generated files exist
parent
62ad61b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
ce080a0f
...
...
@@ -296,9 +296,11 @@ if(NOT PERL_FOUND)
endif
()
function
(
gen_ir target
)
get_filename_component
(
basename
"
${
target
}
"
NAME
)
get_filename_component
(
basename
${
target
}
NAME
)
get_filename_component
(
target_dir
${
target
}
DIRECTORY
)
add_custom_command
(
OUTPUT
${
target
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
target_dir
}
COMMAND
${
PYTHON_EXECUTABLE
}
${
GEN_IR_DIR
}
/gen_ir.py
${
IR_SPEC
}
${
GEN_TEMPLATEDIR
}
/
${
basename
}
>
${
target
}
DEPENDS
${
GEN_IR_DIR
}
/gen_ir.py
${
GEN_IR_DIR
}
/jinjautil.py
${
GEN_IR_DIR
}
/irops.py
${
IR_SPEC
}
)
...
...
@@ -307,11 +309,12 @@ function(gen_ir target)
endfunction
()
function
(
begen generator target spec
)
get_filename_component
(
TARGETDIR
"
${
target
}
"
DIRECTORY
)
get_filename_component
(
target_dir
${
target
}
DIRECTORY
)
set
(
GENERATOR
${
PROJECT_SOURCE_DIR
}
/ir/be/scripts/
${
generator
}
)
add_custom_command
(
OUTPUT
${
target
}
COMMAND
${
PERL_EXECUTABLE
}
${
GENERATOR
}
${
spec
}
${
TARGETDIR
}
COMMAND
${
CMAKE_COMMAND
}
-E make_directory
${
target_dir
}
COMMAND
${
PERL_EXECUTABLE
}
${
GENERATOR
}
${
spec
}
${
target_dir
}
DEPENDS
${
GENERATOR
}
${
spec
}
)
list
(
APPEND SOURCES
${
target
}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment