Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
d11d9250
Commit
d11d9250
authored
Jan 21, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tugs and bugs
parent
aa451fb4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
12 deletions
+42
-12
CMakeLists.txt
CMakeLists.txt
+16
-9
download_boost.cmake
CMakeModules/download_boost.cmake
+1
-0
footprint_info.cpp
common/footprint_info.cpp
+10
-0
common.h
include/common.h
+15
-3
No files found.
CMakeLists.txt
View file @
d11d9250
...
...
@@ -14,6 +14,9 @@ set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules )
# reports.
#
option
(
USE_KIWAY_DLLS
"Build the major modules as DLLs or DSOs, will soon be the norm."
OFF
)
#for those who bored with uppercase
option
(
KICAD_KEEPCASE
"turn-off automatic component name conversion to uppercase if selected"
)
...
...
@@ -146,22 +149,26 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
endif
()
else
()
# We build DLL/DSOs from static libraries, so create position independent
code
#
for all cases, since we do not have DLL/DSO specific static libraries.
#
Subdirectories via add_subdirectores() reference this variable, and it is either set or empty,
# empty for Windows.
# We build DLL/DSOs from static libraries, so create position independent
#
code for all cases, since we do not have DLL/DSO specific static
#
libraries. Subdirectories via add_subdirectores() reference this
#
variable, and it is either set or empty,
empty for Windows.
set
(
PIC_FLAG -fPIC
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
PIC_FLAG
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
PIC_FLAG
}
"
)
if
(
CMAKE_CXX_COMPILER_ID MATCHES
"Clang"
)
set
(
TO_LINKER -XLinker
)
else
()
set
(
TO_LINKER -Wl
)
endif
()
# Thou shalt not link vaporware and tell us it's a valid DSO:
set
(
CMAKE_SHARED_LINKER_FLAGS
"
-Wl
,--no-undefined"
)
set
(
CMAKE_MODULE_LINKER_FLAGS
"
-Wl,--no-undefined"
)
# needed by SWIG macros on linux
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
TO_LINKER
}
,--no-undefined"
)
set
(
CMAKE_MODULE_LINKER_FLAGS
"
${
TO_LINKER
}
,--no-undefined"
)
# Set default flags for Release build.
set
(
CMAKE_EXE_LINKER_FLAGS_RELEASE
"-s"
)
endif
()
# quiet GCC 4.8.1 while in boost
...
...
CMakeModules/download_boost.cmake
View file @
d11d9250
...
...
@@ -170,6 +170,7 @@ endif()
ExternalProject_Add
(
boost
PREFIX
"
${
PREFIX
}
"
TIMEOUT 60
DOWNLOAD_DIR
"
${
DOWNLOAD_DIR
}
"
INSTALL_DIR
"
${
BOOST_ROOT
}
"
URL http://downloads.sourceforge.net/project/boost/boost/
${
BOOST_RELEASE
}
/boost_
${
BOOST_VERS
}
.tar.bz2
...
...
common/footprint_info.cpp
View file @
d11d9250
...
...
@@ -205,6 +205,16 @@ bool FOOTPRINT_LIST::ReadFootprintFiles( FP_LIB_TABLE* aTable, const wxString* a
#if USE_WORKER_THREADS
// Even though the PLUGIN API implementation is the place for the
// locale toggling, in order to keep LOCAL_IO::C_count at 1 or greater
// for the duration of all helper threads, we increment by one here via instantiation.
// Only done here because of the multi-threaded nature of this code.
// Without this C_count skips in and out of "equal to zero" and causes
// needless locale toggling among the threads, based on which of them
// are in a PLUGIN::FootprintLoad() function. And that is occasionally
// none of them.
LOCALE_IO
top_most_nesting
;
// Something which will not invoke a thread copy constructor, one of many ways obviously:
typedef
boost
::
ptr_vector
<
boost
::
thread
>
MYTHREADS
;
...
...
include/common.h
View file @
d11d9250
...
...
@@ -433,16 +433,28 @@ class LOCALE_IO
public
:
LOCALE_IO
()
{
if
(
C_count
++
==
0
)
wxASSERT_MSG
(
C_count
>=
0
,
wxT
(
"LOCALE_IO::C_count mismanaged."
)
);
// use thread safe, atomic operation
if
(
__sync_fetch_and_add
(
&
C_count
,
1
)
==
0
)
{
// printf( "setting C locale.\n" );
SetLocaleTo_C_standard
();
}
}
~
LOCALE_IO
()
{
if
(
--
C_count
==
0
)
// use thread safe, atomic operation
if
(
__sync_sub_and_fetch
(
&
C_count
,
1
)
==
0
)
{
// printf( "restoring default locale.\n" );
SetLocaleTo_Default
();
}
wxASSERT_MSG
(
C_count
>=
0
,
wxT
(
"LOCALE_IO::C_count mismanaged."
)
);
}
private
:
static
int
C_count
;
// allow for nesting of LOCALE_IO instantiations
};
...
...
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