Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eld
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
or1k
eld
Commits
aab8cf62
Commit
aab8cf62
authored
10 years ago
by
Alessandro Di Federico
Browse files
Options
Downloads
Patches
Plain Diff
Update compiler and linker flags and fix a dependency issue
parent
19a76608
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+7
-1
7 additions, 1 deletion
CMakeLists.txt
with
7 additions
and
1 deletion
CMakeLists.txt
+
7
−
1
View file @
aab8cf62
...
...
@@ -10,6 +10,10 @@ project (loader C)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-std=c99 -Wall -Wextra -Wno-unused-variable -Wno-missing-braces -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-but-set-variable"
)
# XXX: ugly, but CMake seems to remove it if I put it in include_directories
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-I/usr/include"
)
set
(
CMAKE_SHARED_LIBRARY_SONAME_C_FLAG
"-Wl,-soname,"
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"-static"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"-Wl,--export-dynamic"
)
include_directories
(
"
${
PROJECT_BINARY_DIR
}
"
)
set
(
OR1K_SIM_PATH
"or32-elf-sim"
CACHE FILEPATH
"Path to the OR1K simulator"
)
...
...
@@ -20,8 +24,8 @@ add_custom_command(
COMMAND bin2c libmy.so -n libmy > libmy.so.h
)
add_custom_target
(
libmy_header DEPENDS
${
CMAKE_CURRENT_BINARY_DIR
}
/libmy.so.h
)
set
(
CMAKE_SHARED_LIBRARY_SONAME_C_FLAG
"-Wl,-soname,"
)
#set(CMAKE_C_COMPILE_OPTIONS_PIC "")
# Test dynamic library
add_library
(
my SHARED libmy.c
)
...
...
@@ -33,6 +37,8 @@ add_custom_target(loader_sim COMMAND timeout 5 ${OR1K_SIM_PATH} -f sim.cfg loade
add_custom_target
(
loader_sim_debug COMMAND
${
OR1K_SIM_PATH
}
-f sim.cfg --srv=9001 loader
)
# Dependencies
add_dependencies
(
loader_sim loader
)
add_dependencies
(
loader_sim_debug loader
)
add_dependencies
(
loader libmy_header
)
add_dependencies
(
libmy_header my
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment